Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
August 14, 2013 at 7:46 pm #27796
Is there a way to add this feature to pages as well? It is very cool.
Thanks
August 15, 2013 at 3:41 am #135388Hi,
Edit template-builder.php, find this code:
echo " </div><!--end builder template-->";Below, add this code:
$pagelist = get_pages('sort_column=menu_order&sort_order=asc');
$pages = array();
foreach ($pagelist as $page) {
$pages[] += $page->ID;
}
$current = array_search(get_the_ID(), $pages);
$prevID = $pages[$current-1];
$nextID = $pages[$current+1];
?>
<?php if (!empty($prevID)) { ?>
<a class="avia-post-nav avia-post-prev without-image" href="<?php echo get_permalink($prevID); ?>" title="<?php echo get_the_title($prevID); ?>">Previous</a>
</a>
<?php }
if (!empty($nextID)) { ?>
<a class="avia-post-nav avia-post-next without-image" href="<?php echo get_permalink($nextID); ?>" title="<?php echo get_the_title($nextID); ?>">Next</a>
<?php } ?>Edit page.php, find this code:
$avia_config['size'] = avia_layout_class( 'main' , false) == 'entry_without_sidebar' ? '' : 'entry_with_sidebar';
get_template_part( 'includes/loop', 'page' );
?>Add this:
<?php $pagelist = get_pages('sort_column=menu_order&sort_order=asc');
$pages = array();
foreach ($pagelist as $page) {
$pages[] += $page->ID;
}
$current = array_search(get_the_ID(), $pages);
$prevID = $pages[$current-1];
$nextID = $pages[$current+1];
?>
<?php if (!empty($prevID)) { ?>
<a class="avia-post-nav avia-post-prev without-image" href="<?php echo get_permalink($prevID); ?>" title="<?php echo get_the_title($prevID); ?>">Previous</a>
</a>
<?php }
if (!empty($nextID)) { ?>
<a class="avia-post-nav avia-post-next without-image" href="<?php echo get_permalink($nextID); ?>" title="<?php echo get_the_title($nextID); ?>">Next</a>
<?php } ?>It doesn’t look exactly like the post nav but the it works.
Regards,
Ismael
-
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
- The topic ‘Posts – Side screen navigation’ is closed to new replies.
