Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #591896

    I would like to use the default pagination of enfold on an archive page template that I created for a custom post type. Is there any shortcut to do that with a code?

    Thanks :)

    #592424

    Hi itsmereal,

    I’m not sure that would be possible but I guess you could use the default WordPress pagination, that should work. Send us a link to your site and we’ll have a closer look.

    Thanks,
    Rikard

    • This reply was modified 8 years, 8 months ago by Rikard.
    #592430

    I have a custom post type called properties. With custom fields created template for the archive, on child theme archive-properties.php
    I am using the following loop code to get the posts on the properties archive page.

    
    <?php
    					 
    					$args = array(
    					    'posts_per_page' => '10',
    					    'post_type' => 'properties'
    					);
    					 
    					// Custom query.
    					$query = new WP_Query( $args );
    					 
    					// Check that we have query results.
    					if ( $query->have_posts() ) {
    					 
    					    echo '<div class="showcase-posts">';
    					 
    					        // Start looping over the query results.
    					        while ( $query->have_posts() ) {
    					 
    					            $query->the_post();
    					 
    					            ?>
    					 
    					            <div <?php post_class( 'showcase-post' ); ?>>
    					            	<div class="showcase-post-thumbnail">
                                          <a href="<?php the_permalink(); ?>">
                                          		<?php if ( has_post_thumbnail() ) { the_post_thumbnail('medium'); }  ?>
                                          </a>
                                       </div>
    					                <div class="showcase-right">
                                            <div class="showcase-post-title">
                                                <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
                                                    <?php the_title(); ?>
                                                </a>
                                            </div>
                                          <div class="showcase-price">
                                            $<?php the_field('price') ?>
                                          </div>
                                          <div class="showcase-address">
                                            <?php the_field('address') ?>
                                          </div>
                                          <div class="showcase-bedrooms">
                                            <i class="fa fa-bed"></i> <?php the_field('bedrooms') ?> Bedrooms
                                          </div>
                                          <div class="showcase-bathrooms">
                                            <i class="fa fa-tint"></i> <?php the_field('bathrooms') ?> Bathrooms
                                          </div>
                                          <div class="showcase-size">
                                            <i class="fa fa-exchange"></i> <?php the_field('size') ?> s.f.
                                          </div>
                                          
                                          
                                      	</div>
                                      
    					            </div>
    					 
    					            <?php
    					     
    					        }
    					 
    					    echo '</div>';
    					 
    					}
    					 
    					// Restore original post data.
    					wp_reset_postdata();
    					 
    					?>
    

    Everything is good but just need the pagination to be working. I would like to use the pagination that is used on blog archive or any archive pages on this theme.

    So, if there is any way to integrate that into the archive-properties.php file, please let me know.

    Thanks in advance

    #593680

    Hey!

    Thank you for the info. Please use the avia_pagination function.

    echo "<div class='custom-pagination}'>".avia_pagination('', 'nav')."</div>";
    

    Cheers!
    Ismael

    #593769

    Thanks guys, for the sake of everyone else who is looking for a similar solution, here is the pastebin link for the full code
    http://pastebin.com/2Fhk8818

    Resolved!

    #594137

    Hi @itsmereal,

    Great, glad we could help and thanks for sharing your solution!

    Best regards,
    Rikard

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Using enfold's pagination on customized archive page template’ is closed to new replies.