Adding thumbnails for non-image attachments
Personally, I would create a custom post type called brush, and use the featured image facility to provide a representative thumbnail. You could then create an archive-brush.php template to show them all.
Personally, I would create a custom post type called brush, and use the featured image facility to provide a representative thumbnail. You could then create an archive-brush.php template to show them all.
Setting the third parameter of get_post_meta to true does not guarantee that you get a string. What that parameter does is control how many rows of the database get returned. When true you only get a single result and not an array of all of the rows in the database that match. You will get … Read more
How about removing the the_title calls from your theme and inserting the title as an H1 into the text. This way you truly decouple things.
Using Hooks. Thematic
I think you don’t have to use meta_query. Simply use the code like shown below: $args = array( ‘post_type’ => ‘property’, ‘meta_key’ => ‘rental_type’, ‘meta_value’ => ‘Vacation’ ‘posts_per_page’ => $properties_per_page, ‘paged’ => $paged ); Also you got to get the value of $properties_per_page before this query.
This will get the posts filtered by custom field and its value based on categories. $args = array( ‘post_type’=>’post’, ‘category__in’=> array(6, 7, 31), //category id ‘meta_key’=>’keys’, // customfield name ‘meta_value’=>5, // customfield value ‘posts_per_page’=>-1, ‘number_posts’=>-1 ); $s = get_posts($args); foreach($s as $e ) { echo $e->ID.'<br/>’; echo $e->post_title.'<br/>’; }
Filter CPT based on meta box value using Flexible Posts widget?
Like this there are many other tutorials to display custom fields as columns in the WordPress admin. The tutorial will help you to unset the columns you don’t want to show and also to show the columns you would like to see. Hope this helps!
You should be able to do this with WP_Query‘s meta_query parameters: $type=”something”; $programme=”another”; $args = array( ‘meta_query’ => array( array( ‘key’ => ‘type’, ‘value’ => $type, ‘compare’ => ‘=’ ), array( ‘key’ => ‘programme’, ‘value’ => $programme, ‘compare’ => ‘LIKE’ ) ) ); $query = new WP_Query( $args );
I don’t think the problem is with the workings of the custom meta field (look into the XY problem). The issue is with the use of relative URLs, whether you realize that that is what you are doing or not. Left empty, <a href=”” target=”_blank”> is by default the page you are on. Likewise, echo … Read more