Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

How would I add an a load more button that displays from the same archive but show posts that are 24 months or older?

<ul> <?php $archive_date = 0; if(is_archive()){ $year = get_query_var('year'); $monthnum = get_query_var('monthnum'); } add_filter( 'get_archives_link', 'wpse_62509_current_month_selector' ); wp_get_archives( array( 'type' => 'monthly', 'limit' => 24) ); remove_filter( 'get_archives_link', 'wpse_62509_current_month_selector' ); ?> </ul>

Darrell Conklin
Darrell Conklin
22,099 Points
<ul> 
    <?php 
        $archive_date = 0; 
        if (is_archive()) { 
            $year = get_query_var('year'); 
            $monthnum = get_query_var('monthnum'); 
        } 
        add_filter( 'get_archives_link', 'wpse_62509_current_month_selector' ); 
        wp_get_archives( array( 'type' => 'monthly', 'limit' => 24) ); 
        remove_filter( 'get_archives_link', 'wpse_62509_current_month_selector' ); 
    ?> 
</ul>