Home › Forums › WoodMart support forum › Product navigation (in single product page) next-previous criterium
Product navigation (in single product page) next-previous criterium
- This topic has 9 replies, 2 voices, and was last updated 1 year, 8 months ago by
Luke Nielsen.
-
AuthorPosts
-
August 17, 2023 at 8:08 pm #489420
supergapParticipantHi,
I would like to better understand the way the Product navigation works.Now it seems it follows the ‘date order’ logic, but I’m not sure. but I’n my opinion is not a good way to go next-previous. The right way should be moving in the same category as primary logic.
Which is the criterium it shows next-previous by? Product ID, Title, Date? Is it possible to decide which is the order to follow? In which way does it choose the ‘next’ category (menu order? category ID, Alphabetical order..)? Is it possible to stop at last product of a category (to not change category and remain in the current category) ? Or to go to the current category by clicking in the central button (4 squares button) instead of the shop page?
Please let me know,
Many thanks.Attachments:
You must be logged in to view attached files.August 18, 2023 at 10:23 am #489531
Luke NielsenKeymasterHello,
In order to display pagination on a single product, we use the default WordPress function
get_adjacent_post
, which sorts by date. Also, we have a filter in the theme when activated, the previous and next products will be derived only from the same taxonomy as the main product, in order to activate it, it is convenient to add this code to the child theme.add_filter( 'woodmart_get_prev_product_same_term', '__return_true' );
Kind Regards
August 18, 2023 at 10:59 am #489539
supergapParticipantHi,
thanks for fast reply.
which is the right way to add the code to php. I did sometimes but I can’t remember the steps to get the editor page in WordPress.
Once in that page I just have to paste this code or I have to add some code before/after to open/close that code addition?Thanks
August 18, 2023 at 11:35 am #489552
Luke NielsenKeymasterHello,
You need to paste that code to the
functions.php
file in your child theme. You need just paste that code.Let me know the results.
Kind Regards
August 18, 2023 at 12:31 pm #489573
supergapParticipantHi,
clear. I just can’t find anymore the ‘Theme Editor’ link in Appearance.
I can find it on other WP sites but not in this 6.3 WoodMart site. Is it moved away in some other place?
Please look at attached file. Thanks again.Attachments:
You must be logged in to view attached files.August 18, 2023 at 2:31 pm #489620
Luke NielsenKeymasterHello,
Here is an article on how to enable the Theme file editor:
https://docs.wpuserregistration.com/docs/how-to-enable-theme-plugin-editor-mode/
Kind Regards
August 18, 2023 at 3:19 pm #489640
supergapParticipanthi,
that line define(‘DISALLOW_FILE_EDIT’, true); is not in my wp-config.php file.
I set anyway the same line (rewriting it with FALSE) but nothing change.I paste the your code in them child function.php file, via FTP and it works fine
add_filter( ‘woodmart_get_prev_product_same_term’, ‘__return_true’ );But I would like to understand why theme editor link is missing in WP backend
August 18, 2023 at 3:34 pm #489648
Luke NielsenKeymasterHello,
The thing is that the Theme file editor is related to WordPress and our theme cannot hide it, please try to read the below solution as well and let me know the result:
Kind Regards
August 18, 2023 at 3:39 pm #489649
supergapParticipantHi,
Already read that article.
Can’t find there any solution.
Thanks anyway.August 18, 2023 at 3:40 pm #489650
Luke NielsenKeymasterHello,
Could you please check how it works with some default WordPress themes like TwentyTwenty or WooCommerce Storefront to understand is it our theme issue or not?
Kind Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register