• 0

WooCommerce for PageLines WooCommerce product navigation (Next product, Last product option)

Question

Posted · Report post

Hello

 

Has anyone managed to get product navigation going on their shop? I want a simple "Next Product" "Last Product" option.

 

Thank you

 

Babs

Share this post


Link to post
Share on other sites

4 answers to this question

  • 0

Posted · Report post

Hi Babs,

 

I was going to suggest using the PostNav Section but that doesn't work with custom post types, just for blog posts. So, I looked and if you are using a child theme or the Pagelines Customize Plugin you can add this code to get pagination -- it will show the product name with an arrow next to it.

add_action( 'woocommerce_after_single_product', 'woocommerce_productnav');
function woocommerce_productnav() {
?>
<div class="post-nav fix">
	<span class="previous"><?php previous_post_link('%link') ?></span>
	<span class="next"><?php next_post_link('%link') ?></span>
</div>
<?php
}

If you want the pagination to show above the product, change woocommerce_after_single_product to woocommerce_before_single_product

 

Hope that helps.

 

Ellen

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

If you still need assistance, please let us know. Otherwise this topic will be closed in 7 days. Thanks! :)

Share this post


Link to post
Share on other sites
  • 0

Posted (edited) · Report post

ellenmva"] @[member="Jenny I tried the code by inserting it into "content-single-product.php" in my child theme but all I get is errors, also the code does not look like it is even formatted correctly? I also tried adding it into my functions.php but thats even worse.

 

Could you expand please and maybe suggest where this should go.

 

Much appreciated.

Edited by thebastion

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

thebastion The code goes in your child theme functions.php file. Make sure you copied all the code. Then, if you are getting an error, take a screenshot and post it. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now