How do I filter a custom post type loop by a field?
Something like this should work: meta_key=hierarchy&meta_value=management This should be added into the query_posts function, that is not shown in your code block, but should come before it.
Something like this should work: meta_key=hierarchy&meta_value=management This should be added into the query_posts function, that is not shown in your code block, but should come before it.
$args = array( ‘meta_query’ => array( array( ‘key’ => ‘author_status’, ‘value’ => ‘active’, ‘compare’ => ‘NOT LIKE’ ) ) ); This Url works http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters
<?php define(‘WP_USE_THEMES’, false); require(‘wp-blog-header.php’); ?> <?php $post_id = 288; echo get_post_meta($post_id, ‘caption’, true); ?> That part is enough – are you sure that this is the name of your custom field and the path to wp-blog-header is resolved and valid?
You are already doing what you need to do, but in another context. $value = get_post_meta($post->ID, ‘rating’, true); Take that value and format it for display. Edit: I installed your whole block of code. You are storing you key, not your ratings value. You need to access that $ratings array again to pull the value. … Read more
I would try if ( $map && $map != “” ) as you set the variable, but it can also contain an empty string.
I’ve recently developed a plugin that can support the custom taxonomy element of this problem. The plugin creates select boxes for each of your custom taxonomy terms and throws the results onto a custom results page (of your choosing): Advanced Custom Post Search It currently doesn’t support custom meta values if this is something you … Read more
You should run WP Query twice. Once for the li elements and the other for the div elements. You do not seem to be doing this? If you want to use jQuery tabs or accordion you may have to run the wp query twice or save the query results in an array and use a … Read more
Firstly, i would use a custom function in your child themes functions file rather than add the code directly to the template file. You can use the WooCommerce conditional tags and hooks in your code. echo get_post_meta( get_the_ID(), ‘collection_text’, true );
Ok, fixed. I changed ‘post_id’ => ‘new’ to ‘post_id’ => ‘rand()’. It’s working but dont know it shout be like that. Can someone that know php check the code ?
You may try a very different approach which I just used recently. Try out the WordPress plugin Pie Register for that, it gives you an easy drag-and-drop interface for customising your registration form, adding custom fields of all sorts and the e-mails being sent and who is being activated. Hope this is what you need!