Custom post types

  • Custom Post Types

    Last night I gave a presentation at the WordPress London meetup. I talked about custom post types in WordPress, something that has really excited me since WordPress 3. I’ve included the video, a rough transcript of the presentation and the slides at the bottom. What we’ll cover What are custom post types When to use…

    Read More

  • Custom Post Type Archive Pages – WordPress

    Need to show your custom post types on your category archive pages? Add this to your functions.php file: add_filter(‘pre_get_posts’, ‘query_post_type’); function query_post_type($query) { if(is_category() || is_tag()) { $post_type = get_query_var(‘post_type’); if($post_type) $post_type = $post_type; else $post_type = array(‘post’,’cpt’); // replace cpt to your custom post type $query->set(‘post_type’,$post_type); return $query; } } Now change the variable…

    Read More

  • WordPress Custom Post Templates

    Once you have built a Wordpres custom post, you will often want to style it using it’s own template. I searhed the web for a solution and courtesy of twothirdsdesign, if found the answer. The template used for a custom post view is decided by the ‘get_single_template()’ function in the wp-includes/theme.php file.  And it basically…

    Read More