I am using the example at populate dropdown wordpress form from database custom table.
I understand the code but I do not know how to execute it. This code should be executed whenever a new Post is started. I am trying to populate two dropdowns.
Edit: I have given this another think. I think the code should go in the Front Page. Then it is called only when the front page shows. Thanks...Dan'l
I am using the example at populate dropdown wordpress form from database custom table.
I understand the code but I do not know how to execute it. This code should be executed whenever a new Post is started. I am trying to populate two dropdowns.
Edit: I have given this another think. I think the code should go in the Front Page. Then it is called only when the front page shows. Thanks...Dan'l
Share Improve this question edited Mar 9, 2020 at 15:13 GreatDayDan asked Mar 9, 2020 at 12:22 GreatDayDanGreatDayDan 153 bronze badges 1- You would put the code for the dropdown in the place you want to put the dropdown. However, it sounds as if you have found the final piece of a puzzle without identifying the foundations. When you say whenever a new post is started, what do you mean? That could mean a number of things, in a number of places – Tom J Nowell ♦ Commented Mar 9, 2020 at 12:56
1 Answer
Reset to default 0Thing is, the code can go to many places. For me, personally, is to develop own plugin and add code there.
If you need to something execute at certain point, use add_action
hook.
From what you wrote, this question might be helpful: add_action hook for completely new post?