Custom field group on page
Registering custom fields group might have been limited to the custom post type. Check the limit so that I should appear everywhere.
Registering custom fields group might have been limited to the custom post type. Check the limit so that I should appear everywhere.
Fixed. Steps 1. Go to WordPress dashboard 2. Click on username at the top bar 3. Click “Edit My Profile” 4. Uncheck “Disable the visual editor when writing” 5. Scroll to the bottom and click “Update Profile”
How about using a proper metabox framework for your project? I’m sure that`s not the single metabox you’ll be using. I recommend you https://metabox.io/meta-box/ – I used it on many of my projects and have features for dynamic fields as well. Happy new year!
So I figured out that WordPress works with arrays inside a custom post_meta by default.
The question: what is the easiest way to convert standard posts with custom fields into a new custom post type There’s no “easy” way. Consider that all posts have custom fields (some are hidden, and WordPress will add them). So you would need to convert post types based on the presence / value of specific … Read more
You must add meta_key to your array. How else the query will know what meta value to use? Try adding ‘meta_key’ => ‘your_key’
You can achieve this using the save_post hook. save_post is an action triggered whenever a post or page is created or updated, which could be from an import, post/page edit form, xmlrpc, or post by email. add_action( ‘save_post’, ‘wpse254017_set_post_title’, 10, 2 ); function wpse254017_set_post_title ( $post_id, $post ){ //This temporarily removes action to prevent infinite … Read more
All you need is to store the post IDs of the products together with the order (easiest is through post_meta). Then you can run a WP_query to fetch all the products. The example below is a system that grants users access to a custom post type and charge credits, and gives options to send e-mail … Read more
What’s the most efficient way to get two queries based on an if statement?
Custom Post types allow to set custom fields (aka meta-data) capability. Just add ‘custom-fields’ capability to your arguments within the array. No need for the plugin just for adding a couple of fields. ‘supports’ => array( ‘title’, ‘editor’, ‘custom-fields’ )