Custom loop request based on custom field

See WP_Query in Codex for info on how to query on custom fields. $args = array( ‘posts_per_page’ => -1, ‘cat’ => 4, ‘meta_key’ => ‘point_score’, ‘orderby’ => ‘meta_value_num’ ); $points_query = new WP_Query( $args ); while( $points_query->have_posts() ): $points_query->the_post(); the_title(); echo ‘ : ‘; echo get_post_meta( $post->ID, ‘point_score’, true ); endwhile;

Setup page template array in a custom post type

//tax_select – this lists all of the categories in a drop-down, we want to change to a checkbox case ‘tax_select’: $terms = get_terms( $field[‘id’], ‘get=all’ ); $selected = wp_get_object_terms( $post->ID, $field[‘id’] ); foreach ( $terms as $term ) { printf( ‘<input type=”checkbox” name=”%s[]” value=”%s” %s/><br />’, $field[‘id’], $term->slug, !empty( $selected ) && !strcmp( $term->slug, $selected[0]->slug … Read more

Display featured posts for a custom post type by taxonomy

If you don’t need a “tag”, I have seen “Featured” items be featured by some a post meta key. I always need a way to feature items, so yesterday I wrote a plugin that will add a metabox to any post type you’d like, with a simple checkbox. Also has columns and quickedit capabilities. https://github.com/helgatheviking/Featured-Item-Metabox … Read more

display two images in theme header.php file

I think you should be using the WordPress loop instead of a foreach, since you’re using WP_Query. <?php if( $header_images->have_posts() ) { while( $header_images->have_posts() ) { $header_images->the_post(); ?> <div class=”header-image”> <?php echo get_the_post_thumbnail( $post->ID, ‘thumbnail’ ); ?> </div> <?php } } ?>

Extra richtext admin textfield for custom posttype with toolbar tabs?

Maby you should use the wp_editor instead? Then you have more control of the editor. An example if you have a meta box called “myfield” in the custom post type. If you want a simple editor you can do like this: echo ‘<form action=”” method=”post” target=”_blank”>’; wp_editor(‘<p>Some content</p>’, ‘myfield’ ); echo ‘<input type=”submit” value=”Submit” /></form>’; … Read more