• Resolved Thoughtlife

    (@thoughtlife)


    Ok.

    Basically I’m trying to figure out how to introduce a slider I’ve created with Nextend Smart Slider Lite (version 1.0.22), just beneath the navigation menu at the top of my website’s homepage i.e. where the default slider for the Custom Community Theme would ordinarily appear (I’ve disabled it).

    my website is http://thoughthouse.org

    I have a shortcode for the slider for use in the widget sidebar but this isn’t where I’d like for the slider to appear. From what I read around the forums here it seems the thing to do is to introduce some coding to the Header.php file or index.php file. However I have no idea what that coding ought to be and where exactly I would need to put it.

    Any help much appreciated.

    Thanks in advance.

Viewing 8 replies - 1 through 8 (of 8 total)
  • See what Konrad was recently recommending, it could be relevant to your question, just put a shortcode in a text widget and drop this widget into the header full width area.

    http://wordpress.org/support/topic/how-add-a-swf-as-header

    Thread Starter Thoughtlife

    (@thoughtlife)

    Hey thanks for the response. Unfortunately I’d tried this already but it doesn’t work too well. The slider goes right where the navigation menu is and interferes with it. Makes the page look a bit weird. Just wish I could figure a way to get it where the default slider would usually be.

    By the way, in my harsh environment the native CC slider didn’t work by itself after upgrading.

    I selected Theme Options – Slideshow – Enable Slideshow
    (there was already ‘all’ by default) and clicked ‘Save Option’.

    It works ever since. 🙂

    Thread Starter Thoughtlife

    (@thoughtlife)

    Hmm. Ok, I’ll do that too to be sure. Thanks. Will report back later.

    Hi Thoughtlife,

    ah sorry i was reading to fast.. 😉

    if you use a child theme and you can call the slider via php i would simply add an action hook to your functions.php..

    i would firstly remove the slideshow via theme settings -> slideshow

    then the action hook in your functions.php should look something like this:

    add_action( 'bp_after_header', 'your_slider_function_name', 2 );

    replace “your_slider_function_name” with the php call to your created slider 😉

    you should find more help how to achieve this last part on the homepage of the slider plugin..

    hope this helps,
    konrad

    Thread Starter Thoughtlife

    (@thoughtlife)

    I think the configuration of my theme seems to be a little different. I can’t find the hook you mention in my functions.php I don’t know if I need to change something in the header.php to get the slider to display. This is what I was thinking I’d need to use.

    <?php echo do_shortcode(‘[SmartSlider 4]’); ?>

    [SmartSlider 4] being the shortcode for my slider. I’ve tried inserting it beneath this;-

    <?php do_action( ‘bp_after_header’ ) ?>

    But it’s had no effect. The slider doesn’t show.

    Hi Thoughtlife…

    weird, does the shortcode work inside a page or post?

    it should work like this and display something..

    but, firstly it would be on every site except you tell your header.php to display it only when your homepage is active.. ** maybe you want the slider on all pages **

    then, the most important thing:

    if you change theme files directly, you would loose ALL YOUR CHANGES with EVERY theme update, as all theme files get replaced when updating the theme.

    so you would have to track all changes and update would be a big mess everytime..

    this is why you should really consider to create a child theme (just google it or lookup in the wordpress docs, very easy).

    then you are update safe and free to change and modify all stuff without loosing your changes!

    in the ne child theme, you would only need your style.css to declare our child theme and an empty functions.php with just your slider function / hook inside.

    your complete functions.php should look like this then: :

    <?php 
    
    add_action( 'bp_after_header', 'your_slider_function', 2 ); 
    
    // thats your fucntion
    your_slider_function() {
    ?><div><?php
    echo do_shortcode('[SmartSlider 4]');
    ?></div><?php
    }
    
    ?>

    tryout, hope this helps, konrad

    Thread Starter Thoughtlife

    (@thoughtlife)

    Hi there.

    I managed to create the child theme as suggested (thanks for the advice, it’s a relief to know any updates will be preserved from now on), it’s now activated on my site. However when I created an empty functions.php in the new child theme folder (I did this by copying the file from the parent theme into the child theme and deleting its contents) and included the above code, it caused my site to disappear. I’ve since deleted the functions.php file in the child theme folder, bringing things back to normal. Did I miss a step? Did I need to do something in the style.css too?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to remove default slider and introduce another slider to homepage’ is closed to new replies.