Custom Fields not working properly
Custom Fields not working properly
Custom Fields not working properly
You’re using $post->ID, but haven’t defined $post anywhere. You either need to specify global $post;, to get the current post in the loop, or define it some other way. But the best way to get this ID would just be to use get_the_ID(): <?php $sub_heading = get_post_meta( get_the_ID(), ‘sub_heading’, true ); ?>
I was able to fix it by using this function add_action( ‘series_add_form_fields’, ‘sermon_series_add_details’, 10, 2 ); instead of this: add_action(‘add_meta_boxes’,’add_Book_series_metabox’);
You can output the exact SQL query generated by WP_Query using $the_final_query->request This should give you the starting point you need to customize your SQL
Custom meta fields not showing up in WP_Response Object via custom endpoint
Update 29.6.19 I think the array_map() error is actually caused by how the selects are named. They have names like tax_input[fuel-type], which probably results in them getting passed to the default taxonomy saving function. As only single value is passed for each select and I assume the tax save handler expects an array, the array_map() … Read more
I ended up having to rework how I did things. Instead of saving the locations as meta data, I created a new custom post type for locations with each location having a lat/lng and the ID of the Event saved to it. So now I have the ability to query all the locations and build … Read more
Yes, and you can use the meta_key along with meta_value parameter. Secondly, you’re going to need two queries when there are no featured posts: Query the featured articles/posts: $q = new WP_Query( [ ‘post_type’ => ‘post’, ‘meta_key’ => ‘featured’, ‘meta_value’ => ‘1’, ‘posts_per_page’ => 3, ‘no_found_rows’ => true, ] ); Query random posts: $q = … Read more
I had the same issue and I did this and it worked: Add 3 options and go to your database. Search for any of those options, when you find them, go to the table it is in. You won’t be able to see the options but just the field name. Export the table you found … Read more
You can use Advanced Custom Fields Plugins for different custom fee fields for each selected category in the same post. You can download free acf plugin for wordpress.org https://wordpress.org/plugins/advanced-custom-fields/