Celebrating 7 Years! Get up to $30 off GeneratePress Premium!

[Support request] How to show slider only front page.

Home Forums Support [Support request] How to show slider only front page.

Home Forums Support How to show slider only front page.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #508379
    somi

    1. Go to Appearance > GP Hooks > After Header

    <?php if ( is_front_page() && is_home() ) {

    // Default homepage ( both the front page and the recent posts page)

    } elseif ( is_front_page() ) {

    // Static homepage

    } elseif ( is_home() ) {

    // Blog page

    } else {

    // Everything else

    }?>

    We are going to use this above coding.
    And we need to modify a little bit like the coding below.

    <?php if ( is_front_page() && is_home() ) {

    echo ‘Default homepage ( both the front page and the recent posts page)’;

    } elseif ( is_front_page() ) {

    ?>

    [metaslider id=”19534″]

    <?php

    } elseif ( is_home() ) {

    echo ‘Blog page’;

    } else {

    } ?>

    Do not forget check ‘Execute PHP’ check box.

    GeneratePress 2.0.2
    GP Premium 1.5.6
    #508495
    Leo
    Staff
    Customer Support

    Hi there,

    I’m not sure what your question is?

    There are a few examples here that might help: https://docs.generatepress.com/article/using-hooks-conditional-tags/

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.