Home › Forums › WoodMart support forum › number of columns for the product page
number of columns for the product page
- This topic has 7 replies, 2 voices, and was last updated 2 years, 5 months ago by
Elise Noromit.
-
AuthorPosts
-
September 27, 2022 at 11:19 pm #408904
loraloraParticipantHello, please tell me the correct solution / workaround or something else?
My problem: I’m adding a shortcode to display recently viewed products on a product page.
Important clarification: I’m using gutenberg – I don’t need the elementor.here is my code: (before that i set cookies for it)
add_shortcode( 'recently_viewed_products', 'mxp_recently_viewed_products' ); function mxp_recently_viewed_products() { if( empty( $_COOKIE[ 'woocommerce_recently_viewed_2' ] ) ) { $viewed_products = array(); } else { $viewed_products = (array) explode( '|', $_COOKIE[ 'woocommerce_recently_viewed_2' ] ); } if ( empty( $viewed_products ) ) { return; } $viewed_products = array_reverse( array_map( 'absint', $viewed_products ) ); $title = '<h5>/h5>'; $product_ids = join( ",", $viewed_products ); return $title . do_shortcode("[products ids='$product_ids' columns='6' orderby='' class='']"); }
My problem:
On the product page, 4 product columns are displayed, despite the fact that I set 6 in the settings.
Then I realized the problem: The number of columns is regulated by this item: (see photo). When I change the value to 6, it works both for the archive pages and for the individual product pages for this particular code.
My question is, is there a way to remove the effect of these customizations for a single product page? So that they only affect archive pages?
But on the page of one product, so that the code does not inherit 4 columns, but is displayed as 6.
I tried changing “Settings” ▸ “WooCommerce”
“Product catalog” – but this does not help because apparently your settings have the highest priority.Attachments:
You must be logged in to view attached files.September 28, 2022 at 12:42 am #408908
Elise NoromitMemberHello,
WoodMart theme is based either Elementor or WP bakery page builder. Our support does not cover Gutenberg and third parties code fixing. You will need to find a developer who would help to you.
If you have any questions please feel free to contact us.
Best Regards
September 28, 2022 at 5:36 pm #409047
loraloraParticipantThe problem is not in my code.
The problem is that the theme settings for the product archive are applied on the product page.
is there a solution for product archive settings not working for product page??
September 28, 2022 at 5:40 pm #409048
loraloraParticipantI need this theme setting to apply ONLY to the product archive settings.
and did not apply to the single product.
Attachments:
You must be logged in to view attached files.September 29, 2022 at 4:03 am #409136
Elise NoromitMemberHello,
Please insert the site admin access into the Private content below the message area. We will take a closer look at the case.
Best Regards
September 30, 2022 at 1:37 pm #409518
loraloraParticipantHello
thanks for your support
sorry i cant give admin rights
Do you have any other ideas?September 30, 2022 at 8:13 pm #409594
loraloraParticipantI found my problem, it is not related to the topic. Topic can be closed
October 1, 2022 at 3:14 am #409629
Elise NoromitMemberHello,
We are glad you have solved the issue.
If you have any questions please feel free to contact us.
Best Regards
-
AuthorPosts
The topic ‘number of columns for the product page’ is closed to new replies.
- You must be logged in to create new topics. Login / Register