Support » Fixing WordPress » Tag.php and multiple custom post types

  • Hello everyone,

    I’m trying to make a tag.php to get all posts with a certain tag displayed. When I do this for one custom post type it works, see code:

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts($query_string .'&posts_per_page=10&post_type=games&paged=' . $paged); ?>

    However, when I add another one (see code below), there’s no output! What is it I’m doing wrong?

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts($query_string .'&posts_per_page=10&post_type=games,projects&paged=' . $paged); ?>

    Hoping for help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Did you figure this out?
    I did have a version of this working in Genesis, however now I’m getting 404 errors on subsequent pages with the below in tag.php:

    <?php
    add_action('genesis_before_loop', 'child_before_tag_loop');
    function child_before_tag_loop () {
        global $query_string;
        $args = wp_parse_args($query_string, array( 'post_type' => array( 'post','abstracts','best-practices' ) ));
        query_posts( $args );
    }
    
    genesis();

    Macmeister,

    When I putt the post types in an array it works. Hope you found a solution as well!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Tag.php and multiple custom post types’ is closed to new replies.