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

    I’ve tried using the transparency option to display my slider in the header region, but I don’t like how it affects the right sidebar and the main menu. I’d really just like to replace the header background image in header_main with my slider, but I’m not sure how to do so. Edit a template file? If so… which one. Any way to stick shortcode or php into that header slot?

    Thanks!

    #299968

    Hey Eric!

    There are some hooks that let you insert content in the header area, try with something like this in your theme / child theme functions.php:

    function add_stuff_to_header_func() {
    	?>
    	HTML_CONTENT_HERE
    	<?php
    }
    add_action('ava_after_main_menu', 'add_stuff_to_header_func');

    That will add content inside the header container, if you want it outside, use:

    function add_stuff_to_header_func() {
    	?>
    	HTML_CONTENT_HERE
    	<?php
    }
    add_action('ava_main_header', 'add_stuff_to_header_func');

    You can use the do_shortcode function to reproduce a LayerSlider using this method.

    Best regards,
    Josue

    #300259

    Perfect. Thank you.

    Got the HTML content in there and was successful putting a background picture and styling its position.
    Can’t get the do_shortcode bit to work. Tried this… still got just the shortcode in square brackets outputted.

    function emj_header_func() {
    	?>
    	<div id="emjheader"><?php echo do_shortcode('[layerslider id="3"]'); ?></div>
    	<?php
    }
    add_action('ava_after_main_menu', 'emj_header_func');

    Layer slider also provides an optional function:
    <?php layerslider(3) ?>
    But when I called it via my function above, it outputted an error that it couldn’t find that function.

    Ideas?

    #300393

    Hey!

    I’ve tested this code on my sandbox installations and it does work. I’d suggest trying the following:

    – Increase the memory allocated to PHP: http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP
    – Disable all third-party plugin and see if the LS comes up.

    Regards,
    Josue

    #300405

    Increased memory to 128M – No Dice.
    Disabled all plugins – No Dice.

    Any chance other items in functions.php (child) are causing problems?

    <?php
    add_filter('avf_blog_style','avia_change_archive_blog_layout', 10, 2); 
    function avia_change_archive_blog_layout($layout, $context){
    if($context == 'archive') $layout = 'blog-grid';
    return $layout;
    }
    add_filter('the_excerpt', 'do_shortcode');
    function emj_header_func() {
    echo do_shortcode('[layerslider id="3"]');
    }
    add_action('ava_after_main_menu', 'emj_header_func');
    ?>

    Do I need to add a filter regarding the shortcode?
    Is it possible I have to call up the layerslider function prior to this function? (think it is already called elsewhere).
    See next post for some private info.

    Thanks for your assistance.

    #300406
    This reply has been marked as private.
    #300409

    Hi Eric!

    The login you posted are not working.

    Regards,
    Josue

    #300465
    This reply has been marked as private.
    #300531

    OK, after some additional fishing, problem solved. See posts:

    https://kriesi.at/support/topic/layerslider-shortocode-disabled/#post-187266
    https://kriesi.at/support/topic/layerslider-not-working-2/

    I purchased the standalone layerslider and disabled the functions.php line… working as expected. Not thrilled with spending another $17… but I”ve lost that much problem solving.

    However, the links above call for commenting out the layerslider line in functions.php of the parent theme. That means, everytime I update, I have to correct this problem. How can I “unhook” that line in my child theme’s functions.php file so I don’t have to watch this carefully?

    Thanks in Advance…

    #300536

    Hey!

    Try putting this line in your child function.php:

    add_theme_support('deactivate_layerslider');
    

    Cheers!
    Josue

    #300537

    Perfect… that did it. Strange that the other post suggests hacking the theme before modifying the child. Anyway, you’ve been very helpful. Best wishes to you. You can close this thread if you like – the issue is resolved on my end.

    #300539

    You are welcome, always glad to help :)

    Regards,
    Josue

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘LayerSlider WP in header_main’ is closed to new replies.