Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #941760

    I would like to add a color section above the footer that shows up on every page or post on my website. Is it possible to create this on one page and then set it to “GLOBAL”, so appears on every page just like the footer – then when you edit it, edits all instances/pages? (Divi has this feature, so I just wondered if Enfold has this now and I’m missing it.

    Thank You!

    #941779

    is it always the same content ?

    there is for example a hook just before footer (ava_before_footer) you can use it to insert shortcode ( f.e. from alb elements)

    
    add_action('ava_before_footer', function() {
    echo '<div class="avia-section main_color special-one"><div class="container">';
    echo do_shortcode("
    [av_postslider link='category,1,14,15' wc_prod_visible='' prod_order_by='' prod_order='' columns='3' items='-1' offset='0' contents='no' preview_mode='auto' image_size='portfolio' autoplay='yes' interval='5' custom_class='']
    ");
    echo '</div></div>';
    });

    you see here the long tail is the shortcode from a post-slider – : you know how to get it from debug mode ?
    the rest is to have the same parameters as a color-section

    • This reply was modified 6 years, 8 months ago by Guenni007.
    #941848

    Hi,

    Thanks for sharing and helping out @guenni007, did you try that out @eleina_shinn?

    Best regards,
    Rikard

    #941858

    or if you don’t want to place a shortcode there
    ( guess a advanced slider will be possible too)

    add_action('ava_before_footer', function() {
    echo '<div class="avia-section main_color special-one"><div class="container">';
    echo do_shortcode("[layerslider id='19']");
    echo '</div></div>';
    });

    and you only want to place some html code there – this will be enough (again the divs got that classes of every color-section and one for your adjustments or an id to anchor for ):

    function some_content_before_footer() {
    ?>
      <div id="last-section" class="avia-section main_color special-one">
    	  <div class="container">
             Some html content, f.e an image
    	  </div>
      </div>
    <?php
    }
    add_action('ava_before_footer' , 'some_content_before_footer');
    #942581

    Yes, I tried this, but it added the element “behind” my footer, not above or before it. You can see my test color section on the homepage above the footer here: https://dev.pitthopkins.org/ – this is, for example, what I would like above the footer on every page.

    The code I added to functions.php file (using yours and adding my shortcode) looks like this:

    add_action(‘ava_before_footer’, function() {
    echo ‘<div class=”avia-section main_color special-one”><div class=”container”>’;
    echo do_shortcode(”
    [av_section min_height='' min_height_px='500px' padding='default' shadow='no-border-styling' bottom_border='no-border-styling' bottom_border_diagonal_color='#333333' bottom_border_diagonal_direction='' bottom_border_style='' custom_arrow_bg='' id='' color='main_color' custom_bg='#51a2ce' src='' attachment='' attachment_size='' attach='scroll' position='top left' repeat='no-repeat' video='' video_ratio='16:9' overlay_opacity='0.5' overlay_color='' overlay_pattern='' overlay_custom_pattern='' av_element_hidden_in_editor='0']

    [av_textblock size='25' font_color='custom' color='#ffffff' av-medium-font-size='' av-small-font-size='' av-mini-font-size='' admin_preview_bg='']
    “);
    echo ‘</div></div>’;
    });

    • This reply was modified 6 years, 8 months ago by Eleina_Shinn.
    #942951

    Hi,

    Thanks for the feedback, though your test element is displaying fine on my end when checking in Chrome. Could you post a screenshot of what you are seeing on your and how to reproduce the problem please?

    Best regards,
    Rikard

    #943137

    Yes, it looks fine now because I removed the code, it didn’t work – I’ve just placed the element on my home page the wayI want it to look, so you can see what I’m trying to accomplish. I want to make this a global element, to display above the footer on EVERY page of the site. Or make it a part of the footer, displaying as shown.

    When I add the code as you described, it didn’t look like that – it placed the blue color section behind the footer, made it the footer background.. And, to complicate matters, I cannot re-produce to show you because now, since I’ve made a child theme, when I go back into the functions.php file of parent theme, this hook is not there “ava_ before_footer”… and it’s not in the functions.php in child theme either, so not sure what to do.

    • This reply was modified 6 years, 8 months ago by Eleina_Shinn.
    #943447

    Hi,

    Thanks for the feedback, though we will need to be able to see the actual problem to be able to help you out. What happens if you use the code in your functions.php file in your child theme?

    Best regards,
    Rikard

    #943494

    One thing first to mention – please use on this board the code tag for code elements!
    i want to test it now with your edited code – but i have to tranfer all exclamation marks back to code quotes that work.

    So more to com – if I have done that …

    #943507

    the thing is that my code implements allready the color section characteristics and settings with the container following
    so only do the content of that color section in it

    because if you have this structure without surrounding containers :

    add_action('ava_before_footer', function() {
    	echo do_shortcode("
    	   here the shortcode from debug mode including the surrounding color-section
    	");
    });

    that does not work

    you have to only do the content in it – you can use container elements like 1/2 etc:

    so to get your insertion shortcode create a new page with your layout you like to have in that section – but without color-section:
    click to enlarge:

    this code comes to :

    add_action('ava_before_footer', function() {
    	echo '<div id="last-section" class="avia-section main_color special-one"><div class="container">';
    	echo do_shortcode("
    		 here comes only the shortcode of the content of that colorsection in it 
    	");
    	echo '</div></div>';
    });

    PS the background-color has to be set via the id : last-section or the class: special-one

    That it does not work with colorsection on that simpler code with no surroundigs has to do with their settings in it:
    i think all alb elements that have this in their config:

    function shortcode_insert_button()
    			{
    				$this->config['type']			=	'layout';
    				$this->config['self_closing']	=	'no';

    color-sections and tab-sections are not self-closing containers !
    a grid-row f.e. will work with that code – and will not break the footer:

    add_action('ava_before_footer', function() {
    	echo do_shortcode("
    	   here the shortcode from debug mode including the surrounding color-section
    	");
    });

    see results on : https://webers-testseite.de/weber/

    #943514

    By the way – i’m astonished that this construct does not influence sidebar behavior !

    On default every color-section ( or tab-section) caused the sidebar to go down those segments !
    but as you can see on my testpage : https://webers-testseite.de/weber/entry-with-audio/
    this inserted color-section is under the sidebar !

    #943865

    Hi,

    Thank you very much for all the detailed explanations @guenni007, much appreciated as usual :-)

    Best regards,
    Rikard

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