Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1267956

    I am looking for a way to add a panel of text (on every page) – like the one saying ‘Christmas Gift Ideas’ here: https://dawesjewellery.co.uk

    I have created this one using the Colour Section element which works for this page, but I want to add the same panel on every page. I was hoping there might perhaps be a function that I could use to insert [xxxx] below the header throughout.

    The main problem is that WooCommerce doesn’t have a simple way to add details like this, so my thinking was if I add it to the header instead it would not interfere with Woo.

    Any ideas?

    #1268352

    Hey ColinWalton,

    Please try enabling debug mode in order to see builder shortcodes: https://kriesi.at/documentation/enfold/intro-to-advanced-layout-builder/#debug-mode

    Then add this to your functions.php file:

    function colin_add_christmas_banner(){
      echo do_shortcode('[your shortcode]');
    }
    add_action('ava_after_main_container', 'colin_add_christmas_banner');

    And replace [your shortcode], with the shortcode of your Color Section element.

    Best regards,
    Rikard

    #1268385

    Hi Rikard,

    Thank you this sounds promising! The bit I am suck on is creating the shortcode of your Color Section element.

    Do you mean copying the enfold code complete? (shown in the private content), or is there a way to make this into a much shorter shortcode?

    Thanks

    #1268910

    Hi,
    Sorry for the late reply, yes you would use the code you posted, but please note that the quotes the code Rikard posted need to be double quotes next to the [your shortcode] like this:

    function colin_add_christmas_banner(){
      echo do_shortcode("[your shortcode]");
    }
    add_action('ava_after_main_container', 'colin_add_christmas_banner');

    this is because the single quotes in the shortcode will break the function if it also is using single quotes to contain the shortcode. Hope that makes sense.

    Best regards,
    Mike

    #1269000

    Hi Mike,

    Thanks that works – for the home page. But on other pages things go all over the place. I suspect the CSS for these pages will need tweaking to make it appear identically on each of the pages.

    Thanks for the help, much appreciated.

    Colin

    #1269033

    Hi,
    Glad this helped, in your shortcode above I don’t see a custom ID or class for the whole color section, adding one could help you apply the style to it easier across your whole site.

    Best regards,
    Mike

    #1269034

    That’s a good idea, thank you!

    C

    #1269238

    Hi,

    Did you need additional help with this topic or shall we close?

    Best regards,
    Jordan Shannon

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.