Tagged: Custom Post Type, pagination
-
AuthorPosts
-
March 2, 2016 at 6:15 am #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 :)
March 3, 2016 at 5:32 am #592424Hi 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, 9 months ago by Rikard.
March 3, 2016 at 5:42 am #592430I 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
March 5, 2016 at 10:36 am #593680Hey!
Thank you for the info. Please use the avia_pagination function.
echo "<div class='custom-pagination}'>".avia_pagination('', 'nav')."</div>";
Cheers!
IsmaelMarch 5, 2016 at 6:26 pm #593769Thanks 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/2Fhk8818Resolved!
March 7, 2016 at 8:46 am #594137 -
AuthorPosts
- The topic ‘Using enfold's pagination on customized archive page template’ is closed to new replies.