How to show custom posts

In the template for your recordings page you’ll want to specify a custom query for the post type in question. $rec_query = new WP_Query(‘post_type=recording’); And then later in your template, you will refer to the query object you created directly instead of relying on the default. For example: while ($rec_query->have_posts()) : $rec_query->the_post();

How to reorder categories for Custom Post Type

If you’re using the default ‘category’ taxonomy for your custom post type, you can just use the My Category Order plugin. If you’re using a custom hierarchical taxonomy, here’s a modified version of the My Category Order plugin that works with custom taxonomies: http://snipplr.com/view/48599/mycategoryorder-custom-taxonomy-mod/ Source: http://wordpress.org/support/topic/plugin-my-category-order-custom-taxonomy-order-and-code-improvements

Is there a (preferable built-in) way to check what custom queries are used in a theme?

I don’t really understand what you’re trying to do, so here goes nothing: There are a lot of hooks within WP_Query. Most of them pass the current instance as one of the arguments. So, here’s how you could check for a “custom query”: function check_wp_query( $posts, $wp_query ) { if ( $wp_query->get(‘my_arg’) ) { // … Read more

Custom Post Type ‘Event’: Chronological list of recurring events from meta_values in array

Here’s the code that finally worked for me: <?php global $events_meta_termine; $today = getdate(); $my_query = new WP_Query(‘post_type=events&posts_per_page=-1&monthnum=’.$today[“mon”]); $events=array(); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; $meta = get_post_meta(get_the_ID(), $events_meta_termine->get_the_id(), TRUE); foreach ($meta[‘termin_group’] as $termin) { $event=array(); $event[‘title’]=get_the_title(); $event[‘date’]=$termin[‘termin_date’]; $event[‘time’]=$termin[‘termin_time’]; $event[‘location’]=$termin[‘termin_location’]; $events[]=$event; } endwhile; wp_reset_query(); $i=0; usort($events, “cmp”); function cmp($a, $b){ return strcmp($a[‘date’],$b[‘date’]); } ?> … Read more

Limit Amount of Pages users can create in Custom Post Types

Check out my plugin Bainternet Posts Creation Limits this plugin helps you to limit the number of posts/pages/custom post types each user can create on your site. Its just what you need. Update open up bapl.php and in bapl_limit_post_count function change on line 44: if ( current_user_can(‘manage_options’) ) {}else{ if (isset($postt[$curent_type])){ //$postt= bapl_getOptions(‘bapl’); foreach ($postt … Read more