Strict Standards: Redefining already defined constructor for class bbdb in /home/themes/public_html/forums/bb-includes/db-mysql.php on line 12

Strict Standards: Declaration of BB_Walker_Blank::start_lvl() should be compatible with BB_Walker::start_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_lvl() should be compatible with BB_Walker::end_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::start_el() should be compatible with BB_Walker::start_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_el() should be compatible with BB_Walker::end_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127
Custom post type page template not working « ThemeShaper Forums

ThemeShaper Forums » Thematic

[closed]

Custom post type page template not working

(2 posts)
  • Started 3 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 3 years ago #

  2. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512


    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512
    helgatheviking

    Moderator

    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 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.


Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GA_Filter::spool_analytics() should not be called statically in /home/themes/public_html/forums/bb-includes/wp-functions.php on line 586

Strict Standards: Non-static method GA_Filter::spool_this() should not be called statically in /home/themes/public_html/forums/my-plugins/googleanalytics.php on line 183