ThemeShaper Forums » Thematic


Custom Post Type Loop - Child Theme

(3 posts)
  • Started 10 years ago by Omegakenshin
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. Omegakenshin

    Hi, I'm new to Thematic, but I really like it,

    I want to know what I'm doing wrong,
    I got this custom post type (CPT) called "Intranet"
    and in a page I want to load a custom template to run the loop with the query for showing these.

    But when I try to change the loop code directly on the page template, I only got a white page.

    I try it in diferent ways:

    <?php $intranet = new WP_Query( array( 'paged' => get_query_var('paged'), 'post_type' => 'intranet', 'posts_per_page' => 8 ) ); ?>
    <?php while ( $intranet->have_posts() ) : $intranet->the_post(); ?>

    and like this

    <?php global $wp_query;
    while ( have_posts()) : the_post(); ?>

    What's the right way to do this in Thematic??

    Posted 10 years ago #
  2. Omegakenshin

    This must be simple for a Thematic Guru!

    Posted 10 years ago #
  3. "a white page" probably means you borked your syntax.

    you might want to check out this tip to see where you went wrong:

    custom post type archives are now native to WP3.1 and can be activated when declaring your post type.... i'm inclined to think it is automatic, but i can't remember exactly.

    custom post type archives are then auto generated by the first template that WP finds according to it's established naming convention, see the Codex

    thematic has an archives.php so that is what thematic uses to display the archive for your post type.

    but you could copy archives.php and rename it to archive-intranet.php to create a custom template for only your particular post type. you won't need to modify the query at all as WP will know exactly what to do.

    but if you need an actual page, page template then make sure your syntax is correct (no missing ; , } ) etc ) and that your post_type name is exactly as you have declared it when defining the post type.

    hope that helps.

    btw- there's no hard and fast rule, but bumping yourself after 3 hours seems a little pushy to me. remember this is a free forum and all help is volunteer. if you want premium support in the form of immediate help, you should pay for it.


    Posted 10 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.