Remove slider on home page

  • DezD

    #7188

    Hi Folks

    I am just starting to get to grips with this amazing theme but have some questions please?

    I would like to remove the Slider from just the home, (static) page but still show it on the blog page if that is possible.

    Also I need to be able to remove the comments from the homepage as well but still allow them on the blog page.

    Finally, (for the moment), I would like the initial posts on the blog page to be a short version of each post with a “read more” link to the full post, is this acheivable and if so I really would appreciate some advise.

    http://www.blog.bigfish-littlefishuk.co.uk

    Any ideas please?

    Many thanks

    DezD

    Prasanna SP

    #37313

    1. http://www.prasannasp.net/graphene-slider-on-other-pages-modifying-theme-functions-using-a-child-theme/

    Use is_home() conditional tag.

    2. Dashboard > Pages and Quick edit static front page and uncheck Allow comments.

    3. Graphene Options > Display > Excerpts display options.

    DezD

    #37314

    Hi Prasanna

    many thanks for getting back to me, much appreciated.

    I have created the php file as your suggest with the following coe:

    <?php
    function graphene_display_slider(){
    graphene_slider();
    add_action('wp_footer', 'graphene_scrollable');
    }

    function custom_enqueue_scripts(){
    if ( ! is_admin() ) { // Front-end only
    wp_enqueue_script( 'graphene-jquery-tools' ); // jQuery Tools, required for slider
    }
    }
    add_action( 'wp_enqueue_scripts', 'custom_enqueue_scripts' );

    function graphene_display_slider(){
    if (is_single() || is_front_page()|| is_home()){
    graphene_slider();
    add_action('wp_footer', 'graphene_scrollable');
    }
    }
    ?>

    This does not remove the slider from the home page: http://www.blog.bigfish-littlefishuk.co.uk/ though. What am I doing wrong?

    Hope to speak soon.

    Thanks again

    Deryn

    Prasanna SP

    #37315

    Don’t put the same function twice. Try this,

    <?php
    function graphene_display_slider() {
    if ( ! is_home() ) {
    graphene_slider();
    add_action('wp_footer', 'graphene_scrollable');
    }
    }

    function custom_enqueue_scripts(){
    if ( ! is_home() ) { // Front-end only
    wp_enqueue_script( 'graphene-jquery-tools' ); // jQuery Tools, required for slider
    }
    }
    add_action( 'wp_enqueue_scripts', 'custom_enqueue_scripts' );

    DezD

    #37316

    Hi Prasanna

    For some reason this removes the slider from the blog page but not the static home page?

    Hope to speak soon.

    Kind regards

    Deryn

    Prasanna SP

    #37317

    Oops! There shouldn’t be a ! before is_home(). This should work.

    <?php
    function graphene_display_slider() {
    if ( is_home() ) {
    graphene_slider();
    add_action('wp_footer', 'graphene_scrollable');
    }
    }

    function custom_enqueue_scripts(){
    if ( is_home() ) { // Front-end only
    wp_enqueue_script( 'graphene-jquery-tools' ); // jQuery Tools, required for slider
    }
    }
    add_action( 'wp_enqueue_scripts', 'custom_enqueue_scripts' );

    DezD

    #37318

    Hi Prasanna

    That seems to be working perfectly, many thanks.

    I’m afraid I know little if anything about php so this will be a steep learning curve, expect to hear lots from me I’m afraid as I’m a keen learner.

    Just one thing, If I want to add the slider to other pages such as the blog page: http://www.blog.bigfish-littlefishuk.co.uk/blog/ how do I do that?

    Speak soon

    Deryn

    DezD

    #37319

    Hi Prasanna

    I think I have just got it; when I create a page I need to select the layout and not use the “Default Layout” option.

    This seems to solve it.

    Speak soon

    Deryn

    Prasanna SP

    #37320

    Hmm.. That should actually put the slider on blog page. See http://codex.wordpress.org/Conditional_Tags#The_Main_Page

    Okay, try this,

    <?php
    function graphene_display_slider() {
    if ( is_page('blog') ) {
    graphene_slider();
    add_action('wp_footer', 'graphene_scrollable');
    }
    }

    function custom_enqueue_scripts(){
    if ( is_page('blog') ) { // Front-end only
    wp_enqueue_script( 'graphene-jquery-tools' ); // jQuery Tools, required for slider
    }
    }
    add_action( 'wp_enqueue_scripts', 'custom_enqueue_scripts' );

    DezD

    #37321

    Hi Prasanna

    The slider is now showing on the blog page but if I wanted to show it on other pages is there anything that I have to add to the php code?

    Speak soon

    Deryn

Viewing 10 posts - 1 through 10 (of 18 total)

You must be logged in to reply to this topic.

Do NOT follow this link or you will be banned from the site!