tags:

views:

25

answers:

2

I wanting to show a particular post type dependent on the page, so for example I have a blog post type, and I want to show that when the user is at /blog and I have a link post type and want to show those when the user is at /link. Is that possible currently I have this code in my index.php

<?php get_header(); ?>
<div id="content"><!-- CONTENT START -->
<h2><?php echo ucwords($post->post_title);?></h2>    
    <div id="subNavigation"><!-- SUBNAV START -->
        <?php
            if(get_the_title($post->post_parent) == "Members Content") {
                $children .= '<li><a href="forums">Forums</a></li>';
                $children .= '<li><a href="members">Members</a></li>';
                $children .= '<li><a href="groups">Groups</a></li>';
            } else {
                $permalink = get_permalink($post->post_parent);
                $children .= '<li><a href="'.$permalink.'">'. get_the_title($post->post_parent). '</a></li>';
            }
          if($post->post_parent)
              $children .= wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
          else
              $children .= wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
              if ($children) { ?>
                  <ul>
                      <?php echo $children; ?>
                  </ul>
              <?php } ?>        
    </div><!-- SUBNAV END -->

    <div id="contentMainInterior"><!-- CONTENT MAIN START -->
        <?php while (have_posts()) : the_post(); ?>
            <?php the_content(); ?>
        <?php endwhile; ?>                
    </div><!-- CONTENT MAIN END -->    
    <div class="clear"></div>
</div><!-- CONTENT END -->

A: 

If you're talking about custom post types, the best way to go would be creating templates for each post type index page. For example, you have a page called 'blog' and assign it the 'blog' template, where you edit the post query to look for 'post_type' => 'blog_post' or whatever your type may be.

Gavin