Display all Custom Post Types in list with links ?

I added a new Custom Post Type called Books.

I added 50 Books to this. How do I display all 50 Book Titles and a link to each individual post ?

Thanks!

  • Anang

    Hi Josh

    Thanks for contacting us. So I assumed here that you want to create an archive page that contain all books then link to detail page ? That's right ? If so you must made sure to select has archive option to True and fill slugs that you want ( it will http://mysite.com/slug to display the archive). After that you need to update your permalink. Go to Settings -> Permalinks and just hits "save changes". So after that you can go to http://mysite.com/slug to have a list of your books there

    Let me know if you have any question :slight_smile:

    Best Regards

  • Anang

    Hi Josh

    You can made archive page only for your custom post. The step is :
    1. Create archive-books.php file
    2. Copy code from archive.php to archive-books.php
    3. You can delete all details but title link on archive-books.php
    4. Save and Done

    Sometimes on archive.php it's called other file to display block structure , for example :
    get_template_part( 'content', get_post_format() );
    If your archive.php has that code, you can replace it with this code, if you want only display the tittle :

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    	<header class="entry-header">
    			<h1 class="entry-title">
    				<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
    			</h1>
    		</header><!-- .entry-header -->
    	</article><!-- #post -->

    Let me know the result :slight_smile:

    Best Regards

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.