• Resolved kyza0010

    (@kyza0010)


    Hey guys,
    I’ve been trying to add next/previous post buttons to my site using the below code:

    /**
     * @snippet       Add next/prev buttons @ WooCommerce Single Product Page
     * @how-to        Get CustomizeWoo.com FREE
     * @sourcecode    https://businessbloomer.com/?p=20567
     * updated code with forum: https://generatepress.com/forums/topic/previous-and-next-buttons-in-woocommerce/#post-637396
     * @author        Rodolfo Melogli
     * @testedwith    WooCommerce 2.5.5
     */
     
    add_action( 'woocommerce_before_single_product', 'tu_prev_next_product' );
    function tu_prev_next_product(){
        echo '<div class="prev_next_buttons">';
            $previous = next_post_link( '%link', '&larr; Previous', true, '', 'product_cat' );
            $next = previous_post_link( '%link', 'Next &rarr;', true, '', 'product_cat' );
    		echo $previous;
       		echo $next;
        echo '</div>';
    }
    

    But i’m having two problems:
    1) I don’t think the products are being linked to in any discernable order – I want it to be sorted in the order the user has selected, i.e. on the category page you can choose the ordering such as ‘Sort by latest/popularity/price etc.’, but I fear it may be going by posted date

    2) I can’t see the buttons appearing on some categories, such as in this one https://katecouragemusic.com/product-category/solos/

    Can you please advise?

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Theme Author Labinator

    (@labinator)

    Hello!

    Thank you for your message and for using our theme.

    The easiest way to resolve your issue without any technical knowledge is to build your store and pages using a page builder. Our theme perfectly supports all popular page builders including the “Elementor” and “Beaver” builders.

    Using a page builder is much easier than customizing buttons in coding. As you would be able to drag and drop the elements that you need to create your perfect store page.

    The NanoSpace is a minimal theme in nature and customizing it requires coding skills. It is much easier, faster, and even better for you to use a page builder.

    Page builders can be used to create category pages and product listings. They are perfectly customizable without coding.

    We hope that helps!

    Best Regards,
    Labinator Team

Viewing 1 replies (of 1 total)
  • The topic ‘Next/previous post not going in order’ is closed to new replies.