Seriously Simple Podcasting
[resolved] Custom Posts Per Page in Template (3 posts)

  1. Anticrombie
    Posted 3 years ago #

    I'm hoping this is a simple response, I'm just not familiar with how the plugin is querying the posts (custom taxonomy?)

    How can I add a 'posts_per_page=10' to the 'archive-podcast.php' so the archive page will show the latest 10 podcasts?

    Here is the loop as I have it now:

    <?php if ( have_posts() ) : ?>
        <?php $feed_link = get_post_type_archive_feed_link( 'podcast' );?>
            <h1 class="page-title" itemprop="headline"><?php _e( 'Sermons' , 'ss-podcasting' ); ?></h1>
              <?php while (have_posts()) : the_post();?>
              <?php $terms = wp_get_post_terms( get_the_ID() , 'series' );
    		foreach( $terms as $term ) {
    			$series_id = $term->term_id;
    			$series = $term->name;
    	   <article class="podcast_episode">
                    <h3><time class="updated" datetime="<?php echo the_time('Y-m-j'); ?>" pubdate><?php the_time('F jS, Y'); ?></time> - <img src="<?php bloginfo('template_directory');?>/icons/microphone.png" width="26" height="23" alt="Sermon">
    		<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
    		<div class="podcast_meta"><?php echo $series; ?><aside></div>
                 <?php endwhile; ?>
    <?php endif; ?>

    Thanks in advance for any help you can give.


  2. Hugh Lashbrooke
    Plugin Author

    Posted 3 years ago #

    The archive page uses WP's main query loop, so the amount of episodes shown is taken from the amount of blog posts you have set to show per page in Settings > Reading. If you would like to edit it though, you can use the pre_get_posts filter - that's the correct way to edit the main loop on any given page. When using it just make sure it only triggers on the archive page for the podcast post type by using is_post_type_archive( 'podcast' ).

  3. Anticrombie
    Posted 3 years ago #

    Perfect! 'is_post_type-archive' is exactly what I needed.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Seriously Simple Podcasting
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.