Return to Support

Replace Slider on Home Page

Home Forums Graphene WordPress theme Support Replace Slider on Home Page

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2826
    Anonymous

    Hi Guys,

    I”ve been pouring over this a while now and I can’t seem to find the solution: I want to replace the default slider on the home page with the Nivo Slider (http://nivo.dev7studios.com/) in the JQuery format. Unfortunately, I haven’t been able to find the right place to inject the code so that it keeps the same style and location on the homepage. I’ve experimented in the Header.php, theme index.php and functions.php files and I just can’t seem to find the right place.

    Any ideas?

    Thanks in advance!

    Lukas

    #22186

    I’ve experimented in the Header.php, theme index.php and functions.php files and I just can’t seem to find the right place.

    I hope that you are not editing core theme files. This could cause problems down the road.

    I also hope that I am not sounding like a broken record (broken mp3 player?), but use a Graphene action hook widget area. These are incredibly powerful tools.

    Read my tutorial here:

    http://blog.kjodle.net/2011/11/04/graphene-action-hook-widgets-an-easy-way-to-modify-your-blog/

    Install the PHP widget like I mentioned in the tutorial. Create a widget area in loop.php — I would suggest graphene_before_post as a place to start. (If this isn’t right, you’ll have to experiment a little here.)

    This page tells you to insert this code into your template file:

    <?php if ( function_exists('show_nivo_slider') ) { show_nivo_slider(); } ?>

    In this case, you would drag a PHP widget over to that action hook area and paste that code in that widget.

    Unfortunately, this will install the slider on every page and post. Maybe this is what you want. If not, you have two options:

    First Option: install the Widget Logic plugin, to control where that widget appears.

    Second Option: alter the code above to something like this:

    <?php if ( is_home() ) && if ( function_exists('show_nivo_slider') ) { show_nivo_slider(); } ?>

    This is not tested, but I believe it will work. If not, someone with greater PHP skills than mine will point out where I went wrong.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.