ThemeShaper Forums » Thematic

[closed]

Custom post type page template not working

(2 posts)
  • Started 2 years ago by iyamdman
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. iyamdman
    Member

    I am learning Wordpress and modifying the Themeatic framework, but I am learning as I go.

    I have a custom post type called 'wheels'.

    I took the page.php file, and renamed it wheels_page.php

    I added the page template header.

    Now I only want it to display posts only for the post type "wheels".

    I added this line to the new page template (I put it just under the "container"):

    <div id="container">
    
    		<?php query_posts(array('post_type'=>'wheels')); ?>
    
    			<?php thematic_abovecontent(); ?>
    
    			<div id="content">

    I then created a page called "Wheels" and used wheels_page as the template.

    The PROBLEM is that when I open the page, it only shows one post, even though there are 6 post in "wheels".

    Clearly I am not in the loop, but I have no idea where to find it, let alone how to make it a working page template.

    Can someone help me?

    Posted 2 years ago #
  2. you are so going about this the wrong way.

    please read the codex on Template Hierarchy... which is geeky wordpress speak for which wordpress template will display what type of content

    http://codex.wordpress.org/Template_Hierarchy#Custom_Post_Types_display

    basically you can copy index.php, rename it archive-wheels.php and it will automagically show all the wheels posts, since it would be following the correct naming structure outlined in the codex

    or if you insist on doing it the 'page-template' way instead of using the built in approach, then you'd do better to copy from the blog template instead of page.php

    template-page-blog.php

    hope that helps!

    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.