最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

custom field - Where does php code to load data go?

programmeradmin1浏览0评论

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
Add a comment  | 

1 Answer 1

Reset to default 0

Thing 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?

发布评论

评论列表(0)

  1. 暂无评论