Copy content stored in meta to post content
I’m working on a site that had an existing theme that used meta fields to store blocks (bad practice IMO but pre-block editor).
I’m attempting to add a class to posts when the meta key ‘checkbox’ is clicked. Here’s what I have:
What are the canonical rules for the ID numbers of posts, pages and CPTs? Especially as they are created programatically.
Author’s and visitors’ names use the same color in comments.The point here is that the color of the author’s name is different in the comments. For example, in visitor comments, name is red. But, the name of the site author should be gray. (Only in comments)
I have a custom post type created in my theme, the post type is called “Portfolio”. I would like to entirely duplicate this custom post type and give it the name “Projects” so it would display in the admin menu as a new post type.
In previous situations I have been able to add a custom meta field to posts, the code was this:
I want to update the wp_postmeta table in the database based on 2 keys, is there a way to do that using any of the wordpress default functions. This is my DB query which is working fine:
I’ve created a meta box. The code is:
I’m working on a site that had an existing theme that used meta fields to store blocks (bad practice IMO but pre-block editor).
INSERT ON DUPLICATE KEY UPDATE Mysql query is not working with Postmeta table. It adds new/duplicate rows to the table. I couldn’t find a way to solve this. I need to use this as part of a bulk import script.
How can I update multiple fields/Custom fields for the same post using only one call?