-
AuthorPosts
-
November 6, 2020 at 10:09 am #1258814
Hello,
Can you please guide me to add a header to some specific Woocommerce pages ?
Please see the details in private.Thanks !
November 6, 2020 at 1:20 pm #1258854Hey longip,
Please refer to this post – https://kriesi.at/documentation/enfold/intro-to-layout-builder/#debug-mode and enable ALB debugging mode.
Then edit your page where you have your header and copy shortcode of the section you would like to insert to the top of your product.
Then add following code to Functions.php file of your child theme and replace the shortcodeadd_action('woocommerce_before_single_product','av_woocommerce_before_single_product'); function av_woocommerce_before_single_product(){ if(is_product(7791)){ echo do_shortcode("[Your shortcode goes here]"); }}
Best regards,
YigitNovember 6, 2020 at 10:23 pm #1258963Hello Yigit,
Thank you for your reply!
By editing the product do you mean to add the shortcode on top of the description of the product ?
Because I did this and I do not get the expected result.The page become a complete mess but look a bit like what I want to achieve :)
November 9, 2020 at 4:05 pm #1259281Hi,
No, you would need to edit the page where you have text star etc. :)
If you would like us to do it for you, please post FTP and WP admin logins here privately :)
Best regards,
YigitNovember 10, 2020 at 6:38 pm #1259644Sorry, but I do not understand.
Why do I have to edit the page ? The page it is OK as it is.I want to have the same data as in the page on top of the product pages of WooCommerce.
November 11, 2020 at 1:19 pm #1259872Hi,
You would need to edit the page to get the shortcode of the section :)
It is the section I showed in screenshot in private content field that you would like to display on top of every single product page, is that correct?
If so, you would need to use the code as followingadd_action('woocommerce_before_single_product','av_woocommerce_before_single_product'); function av_woocommerce_before_single_product(){ if(is_product()){ echo do_shortcode("[Your shortcode goes here]"); }}
Best regards,
YigitNovember 11, 2020 at 5:59 pm #1259935So sorry, but it does not work. Please see private.
November 17, 2020 at 6:29 am #1260904Hi,
Thank you for the updat.e
What do you mean exactly by “Woocommerce pages”? Are you referring to the product category pages or the single product pages? You should replace the shortcode above with the actual markup of the layout in the screenshot, and instead of using woocommerce_before_single_product, try to use the ava_after_main_container hook so that the content renders below the header.
Best regards,
IsmaelNovember 22, 2020 at 11:29 am #1262080Sorry for my late reply. But, it does not work. Please see private.
November 25, 2020 at 5:02 am #1262890Hi,
Thank you for the update.
You may need to extract the actual markup or html instead of using the shortcodes because the theme closes the containers prematurely, which breaks the layout the page. This is the extracted markup from the above shortcode.
// https://pastebin.com/MXRuBuep
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.