Tag Info

New answers tagged

1

I'm not sure if this is the whole problem but it seems you 'posts_per_page' is sitting inside your 'meta_query' while it should sit in the same level as 'post_type' and 'category_name'...


1

As you've already get results with tag I'm going to give suggestion only for address and rating. For your current situation, the best option is to use Wordpress post meta to store these values. Then you can use meta query to retrieve those posts. $args = array( 'post_type' => 'hotel', 'meta_query' => array( array( 'key' ...


0

Ok, I found the answer. It's a quite stupid copy/paste mistake. The name of my nonce_field was not unique. I had already created another nonce from the same plugin but another file. Therefore the basename(__FILE__) value was different leading to a different nonce. All I had to do was change the the name of the field to something unique and it worked.


0

I would recommend using the php core function money_format() the code should look something like this: $meta = get_post_custom($post->ID); // value=123456 setlocale(LC_MONETARY, 'en_US'); echo money_format('%i', $meta) . "\n"; // USD 1,234.56 Cheers


0

Have you look for a plugin called ACF (Advanced Custom Fields) the plugin can be found here: https://wordpress.org/plugins/advanced-custom-fields/ with this plugin you can add as many custom fields as you want and also there is the logic functionality in the plugin you can make dependencies. for example you want to create some additional custom field for ...


0

If you are not using multiple key & values, I'd try it this way // This function adds a meta box with a callback function of my_metabox_callback() function add_my_meta_box() { $var1 = 'this'; $var2 = 'that'; add_meta_box( 'metabox_id', 'Metabox Title', 'my_metabox_callback', 'page', ...


0

If using css: #edit-slug-box { display: none; }


0

Never mind , i was hooking the metaboxes on plugin_run() Moved them to admin_menu() and now it works OK Regards


0

by default there will be no metabox for custom post typs. Either you can add plugin like ADVANCED CUSTOM FIELD or you can write a code for adding meta box to ur custom post types. Clear reference site: https://thomasgriffin.io/how-to-automatically-add-meta-boxes-to-custom-post-types/ // look at this link add_meta_box( 'meta_id', 'My Custom Meta Box', ...


0

Does this do the trick? $consignment= get_post_meta($post->ID, 'availability', true); if ($consignment == '') { // code to run if the above is empty, eg. echo "avaliable"; } else { // else the code, eg. echo $consignment; }


0

display by ID: if 'id' => 'my-meta-box-2', then ID, 'my-meta-box-2', true ); ?> if you are using the rwmb plugin view the resource to echo the plugin correctly.


0

The whole bunch of code is to replicate the process, not to give the actual code. You have to figure out how your process can be meet up with this scenario. I commented on every possible line, please see the inline comments to get proper understanding. Step #1 First of all, the first portion of your code makes a Custom Meta Box, so use the portion to make ...



Top 50 recent answers are included