Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #279795

    Hello,

    Is this section hooked at the header or under the header? I’d like to have a colored section above the title & breadcrumbs section. When I create a color section with Advanced Builder, I saw the option to have it on the head, which I did, expecting it to be above the title & breadcrumbs… but it didn’t. It appeared under.

    Is it possible to make it appear above?

    Thank you very much,
    George

    #279865

    Hi George!

    You’d need to use another approach for that, try adding this to the theme functions.php (at the very end):

    function add_stuff_before_breadcrumbs() {
    	echo do_shortcode("[av_section]...[/av_section]");
    }
    add_action('ava_after_main_container', 'add_stuff_before_breadcrumbs'); 
    

    Replace “[av_section]…[/av_section]” by the actual shortcode content you want to include, you can enable this and build it using the Layout Builder, then simply copy the generated shortcodes that will appear below the editor.

    Regards,
    Josue

    #279873

    Hi Josue,

    If I add this code to the Child theme’s functions.php instead of the main one, will the result allow me to save the Advanced Builder’s generated page with just that color section on top of the Title/Breadcrumbs as a template to use it on a few other dozen pages?

    Or better yet, is there some kind of documentation similar to this guide that shows avia’s hooks so I can easily move whatever I need to the hook I need without having to bug you all the time? :)

    Thank you,
    George

    #279889

    Hi George!

    You don’t need to put anything on the actual Page to get this working, basically this code is inserting a [shortcode] before the breadcrumbs on all Pages, you can also change it so it will only affect a few:

    function add_stuff_before_breadcrumbs() {
    if(is_page(3,5,6)){
    	echo do_shortcode("[av_section]...[/av_section]");
    }
    }
    add_action('ava_after_main_container', 'add_stuff_before_breadcrumbs'); 
    

    With the page IDs you want to affect. There isn’t a hook visual guide yet, but that’s definitely a great idea, i’ll see if we can come up with something like that in the future.

    Cheers!
    Josue

    #280279

    Hi Josue,

    Thank you very much for the code. It adds a section built on Advanced Builder above the Title/Breadcrumbs but then it breaks the rest of the page.

    When the code used on a No Sidebar page layout, it fills the whole page content with the same color of that in the Advanced builder’s shortcode.

    If the code used on Sidebar page layout, the section’s color remains only on that section, as it should but the contents inside the color section only use the page’s main content width (although the shortcode is for a full width section), it pushes the sidebar content to the bottom of the page and it also breaks the footer and socket sections by forces them to also use the left content of the page and removes the full width color from the footer & socket sections.

    On your second code snippet for conditional pages, it only works on the first page of the array (it also breaks that page the same way as above) and ignores the rest of the page ids on the array.

    I think that the best and easiest way for such a shortcode to work it will be to be included within a <div> in a page template (using the template-builder.php, template-archives.php, etc code) right after the get_header(); call instead of the functions.php. Is this doable?

    Thank you very much again for your help!
    George

    #280280

    I have not tested that but you could try it (page.php:7, template-builder.php:13), the code should need to be simplified:

    if(is_page(array(3,5,6))){
    	echo do_shortcode("[av_section]...[/av_section]");
    }

    The is_page conditional should work now (forgot the array).

    Regards,
    Josue

    #280347

    Hi Josue,

    The above code works on all pages. I even mentioned array above, but didn’t even noticed that the array was missing. :)
    It still though, the code will add the Advanced Builder shortcode element but then it breaks the rest of the page, no matter where I use it. I tried using it after the get_header(); call on page.php, template-builder.php and even template-archives.php with the same result. Breaks the page completely,even the footer on pages with Sidebar layout and bleeds the shortcode section’s color on the whole page when used on the No Sidebar layouts.

    There should be an way to add elements (for a tagline or CTA buttons) to a hook between the header & breadcrumbs.

    Thank you,
    George

    #280348
    This reply has been marked as private.
    #280413

    Hi!

    Adding a color section to the header is not easily possible because it completely breaks the html structure. It can be done but requires quite a lot of testing and tweaking and it’s not something we can assist you with. If you want to add additional content to the header (below the menu and above the breadcrumb use this code:

    
    function add_stuff_before_breadcrumbs() {
    	echo '<div class="stretch_full container_wrap alternate_color light_bg_color title_container"><div class="container">';
    	echo 'Some html content';
    	echo '</div></div>';
    }
    add_action('ava_after_main_container', 'add_stuff_before_breadcrumbs'); 
    

    and replace “Some html content” with your html code. You can also try to use the do_shortcode() function if you want to add a shortcode.

    Cheers!
    Peter

    #280448

    Hi Josue & Peter,

    Thank you both very much! I got it working using a combination of your codes.

    It worked with Peter’s code replacing the “Some html content” with the do_shortcode() function. Then from the shortcode I removed the [av_section] [/av_section] tags of the shortcode which was what was breaking the html and used everything else in between.

    A couple lines of css to add color to the container divs and it now works as I wanted.

    Thank you very much to both for your help!
    Best,
    George

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Title & Breadcrumbs Section’ is closed to new replies.