I just created a custom post type "publication" with the slug "publications".

Now im stuck trying to view all the publications index in a URL like:


Do I have to create some custom layouts for it, and how it will be using an index clone of twentyten theme, maybe using get_template_part?

Thanks in advanced.

  • I just tried publication.php (index.php clone) with get_template_part( 'loop','publication' ); and loop-publication.php (loop.php clone) but doest work. I get: Not Found – José Pablo Orozco Marín Feb 7 '11 at 15:05

In WordPress 3.1 virtual directory is created for you custom post type and so you don't really need to do anything but if you are on a earlier version then you will need to make a few step:

which you have done most but you will need to change loop-publication.php and add your custom post type to the query args or replace the loop with your custom loop that includes the custom post type in the args something like this:

<?php $loop = new WP_Query( array( 'post_type' => 'publication', 'posts_per_page' => 10 ) ); ?>

<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>

    <?php the_title( '<h2 class="entry-title"><a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a></h2>' ); ?>

    <div class="entry-content">
        <?php the_content(); ?>
<?php endwhile; ?>

now since you want to view the list on http://www.myExampleSite.com/publications add this code to the very top of your publications.php

Template Name: publications

then create a page and change its slug to 'publications' and select publications as page template.

and you are set to go.

  • And if only this custom type has a relation with a custom taxonomy (Publisher) with slug (myExampleSite.com/publisher) which will be the layout-clone structure? Thanks in advance. – José Pablo Orozco Marín Feb 7 '11 at 15:53
  • create taxonomy-Publisher.php and you are done. – Bainternet Feb 7 '11 at 16:03
  • Is custom taxonomy tag. Then I clone: tag.php to tag-publisher.php and change get_template_part( 'loop', 'tag' ); to get_template_part( 'loop', 'publisher' ); But im still getting Page not found. Thanks. – José Pablo Orozco Marín Feb 7 '11 at 16:16
  • Nop that's no how it works you need to call it taxonomy-Publisher.php – Bainternet Feb 7 '11 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.