1- Posar al code snippets el següent codi:
add_action( 'woocommerce_before_single_product', 'dcms_single_product_pagination' );
add_action( 'woocommerce_after_single_product_summary', 'dcms_single_product_pagination' );
function dcms_single_product_pagination(){
echo "<div class='dcms-prev-next'>";
previous_post_link( '%link', '← %title', true, '' ,'product_cat' );
next_post_link( '%link', '%title →', true, '' , 'product_cat' );
echo "</div>";
}
2. posar al css el següent:
.dcms-prev-next{
display:flex;
justify-content:space-between;
}
.dcms-prev-next a{
border:1px solid #ddd;
background-color:#efefef;
padding:4px 16px;
}
Font: https://decodecms.com/anterior-y-siguiente-en-la-pagina-de-producto-de-woocommerce/