WordPress.org

Ready to get started?Download WordPress

Forums

Page 2 modifications (3 posts)

  1. christiang69
    Member
    Posted 2 years ago #

    Hello, I have a wordpress installation on my client's page https://www.businessfinancestore.com/, but I have a slider on the front page and when I search for the older posts, the slider is still there.

    I tried is_home and also is_frontpage, but it does not work. It is still displaying when I get to page 2 (https://www.businessfinancestore.com/page/2/).

    If I was not using permalinks, I could use the ?paged=2 variable, but since I am using the permalinks I would like to know how I can prevent this from displaying.

    Thanks in advance for any help.

  2. You can check what page your on using $paged = $wp_query->query_vars[ 'paged' ];

    $paged = $wp_query->query_vars[ 'paged' ];
    
        if ( have_posts () ) :
    
            if ( $paged < 2 ) {
                // Slider code here
            }
            while ( have_posts () ) : the_post ();
                // Continue with the loop
  3. christiang69
    Member
    Posted 2 years ago #

    thanks, this works perfectly.

Topic Closed

This topic has been closed to new replies.

About this Topic