-
AuthorPosts
-
May 24, 2016 at 5:58 pm #637671
My goal is to have a layerslider inside the header. This is because I want then the header to be stretched and fixed so that the content scrolls underneath. I could put the slider in a color section but then everything would be overlayed covering the slider. So I tried this function in my child functions.php:
function add_stuff_to_header_func() { HTML goes here } add_action('ava_after_main_menu', 'add_stuff_to_header_func');
…but can’t figure out how to embed the slider (i.e layerslider 3) and all I get in return is an empty page.
Then I tried to edit header.php in my child theme adding:
<?php if ( is_page( 'home' )) echo do_shortcode('[layerslider id="3"]'); ?>
…right after wrap_all with no success.
Any suggestion? Thanks- This topic was modified 8 years, 6 months ago by alby54.
May 25, 2016 at 7:02 am #637885Hey Alberto,
Could you provide us with a link to the site in question so that we can take a closer look please?
Regards,
RikardMay 25, 2016 at 11:57 am #637958Actually what I did so far is setting a normal header (links in private content since it’s not my own website) and as you can see I’m having troubles narrowing the viewport that’s why I’m thinking about putting everything in a slider.
May 26, 2016 at 1:22 am #638364In a couple of days I have to show the correct layout to my client…….any clue?
May 26, 2016 at 3:17 am #638402Hi!
Sorry for the delay, please do not bump your tickets as it will push to the bottom and we cannot get to it quickly.
Add a header widget as mentioned in this link http://kriesi.at/documentation/enfold/adding-a-widget-area-to-the-header/
Then use a text widget with a shortcode to the slider in it :)
Let us know if you have any questions…
Regards,
VinayMay 26, 2016 at 8:42 am #638580Thank you I’ll give it a try…..sorry for the bumb. Can I add more than one widget area? I have one header for the home page and at least another one for regular pages.
May 26, 2016 at 9:53 am #638605OK, I’ve tried what you suggested and I have 2 questions. Without extra plugin I cannot put shortcodes in a widget (I’ve tried 3 plugins : Shortcode widget to insert shortcodesdirectly in the widget area, and php text widget,php code widget to insert the slider by php code……none of them worked). Since all I get in the header area is the old header and the shotcode visible as text and not the slider…. how do I insert a layerslider in the Text widget? Second question…..what should I do with the old header setting? Should I insert a blank gif as a logo…..or everything gets bypassed by the header in widget function? (I don’t think so because I can still see it)
May 26, 2016 at 1:22 pm #638683Wait…..my fault. I just figured out that I can’t insert the slider via shortcode in the widget with the Enfold version of the plugin so I purchased the full version. Now I see the slider in my homepage but I don’t know how to insert a different slider for the other pages ’cause the enfold_customization_header_widget_area function, the way it is, allows me to set only one custom widget. Should I try to insert a conditional statement in the function? Something like:
add_action( 'ava_main_header', 'enfold_customization_header_widget_area' ); function enfold_customization_header_widget_area() { if ( is_page( 'home' )) { dynamic_sidebar( 'header' ); } else { dynamic_sidebar( 'whatever' ); } }
Thank you for your support
May 27, 2016 at 4:41 am #639065Hi,
Yes, using conditional function like is_page() should work if you want to display different sliders on specific pages.
Best regards,
IsmaelMay 27, 2016 at 2:33 pm #639296Thank you, I just used the above function and it worked like a charm! Also with ‘wp-mobile-detect’ plugin I was able to edit the widget assigning different sliders for iPad and mobile,,,,,Great!!
- This reply was modified 8 years, 6 months ago by alby54.
May 28, 2016 at 10:49 am #639718Hi,
Great you found a workaround for this and thanks for sharing the tip here.
Please feel free to contact us via new ticket if you have more questions :)
Thank you for using Enfold.
Best regards,
Vinay -
AuthorPosts
- The topic ‘Layerslider in header’ is closed to new replies.