• Resolved Anticrombie

    (@anticrombie)


    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' );?>
         <header>
            <h1 class="page-title" itemprop="headline"><?php _e( 'Sermons' , 'ss-podcasting' ); ?></h1>
         </header>
         <section>
              <?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;
    			break;
    			}
    	   ?>
    	   <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>
    		</h3>
    	     </article>
                 <?php endwhile; ?>
    	</section>
    <?php endif; ?>

    Thanks in advance for any help you can give.

    https://www.ads-software.com/extend/plugins/seriously-simple-podcasting/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Hugh Lashbrooke

    (@hlashbrooke)

    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' ).

    Thread Starter Anticrombie

    (@anticrombie)

    Perfect! ‘is_post_type-archive’ is exactly what I needed.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Posts Per Page in Template’ is closed to new replies.