How to organise via Custom Fields on Category Page
you can use query_posts to sort the post by you custom field, Add this before you loop query_posts( $query_string . ‘meta_key=eventdate&order=ASC&orderby=meta_value’);
you can use query_posts to sort the post by you custom field, Add this before you loop query_posts( $query_string . ‘meta_key=eventdate&order=ASC&orderby=meta_value’);
I’m not sure if I’m meeting all of your requirements here, but I think this might work. <div class=”source”> <?php $name = get_post_meta($post->ID, ‘sourcename’, true); $url = get_post_meta($post->ID, ‘sourceurl’, true); $title = get_post_meta($post->ID, ‘sourcetitle’, true); $snippet = str_replace( “http://”, “”, $url ); $snippet = substr( $snippet, 0, 22 ) . “…”; if ( !empty( $title … Read more
You can use get_post_meta() function to retrieve values of fields. Example : To retrieve the value of date metabox use following code. get_post_meta(get_the_ID(), ‘date’, true);
This is doable, the meta data itself has no heriarchy, they’re simple key value pairs attached to a Post ID, nothing more. You would be ebtter implementing these yourself via metaboxes, rather than relying on a dedicated generic plugin as you have been doing. It would take you a lot more time and effort to … Read more
This is the answer – code to be added in the functions.php: add_filter( ‘the_content’, ‘my_the_content_filter’, 0 ); function my_the_content_filter( $content ) { if ( is_single() ) { global $post; $pgLnk=get_post_meta($post->ID, ‘Button’, true); $content .= ‘<div id=”button-link”><a href=”‘.$pgLnk.'” target=”_blank”> <span class=”button-link”></span></a></div>’; } return $content; } This code was wrote by @Sheikh Heera on stackoverflow.com – direct … Read more
I think the answer is that there is no easy way to achieve what you’re looking for because nobody would want that behavior. Custom/meta fields get added to posts for all kinds of reasons, plugins do it all the time to store things you’d never want the public looking at both because it might be … Read more
If you have several posts with the same value, but you want only the most recent ones with any value, as long as values don’t get repeated, you’r best bet might be running two loops on the same query: /* Fetch all possible values – use this to order the results and define which get … Read more
sorry you were having trouble with my “Holy Grail”. It looks like you missed an important part in my functions.php sample: apply_filters(‘meta_content’,$simple_textarea->get_the_value(‘test_editor’)); You weren’t using WP Alchemy’s get_the_value method. So instead of: $richtextcontent = $page_type_richtext->the_value( ‘richfield’ ); yours should have been: $richtextcontent = $page_type_richtext->get_the_value( ‘richfield’ ); You were using the_value which echos out the value … Read more
Sure it is, it is open source so you can hack it anyway you like as long as you know how to code 😉 There are three ways I see to do this: Find a plugin that does this Write (or modify a existing) plugin to reach this (Bad) For your template edit comments.php in … Read more
Just tell the loop to continue if the custom field is 0 or blank. if ((get_post_meta($post->ID,’60mins’,true))||/*however it returns as blank*/) { continue; } This will prevent it from being factored into the average.