Title: Conditional for Infinite Scroll?
Last modified: February 22, 2021

---

# Conditional for Infinite Scroll?

 *  Resolved [Rough Pixels](https://wordpress.org/support/users/roughpixels/)
 * (@roughpixels)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/conditional-for-infinite-scroll/)
 * I am adding Jetpack support to an older theme and although I have infinite scroll
   working, my blog navigation is still showing after the initial batch of posts.
   Is there something I missed or is there a PHP conditional to not load the blog
   nav when Infinite Scroll is enabled?

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Bruce (a11n)](https://wordpress.org/support/users/bruceallen/)
 * (@bruceallen)
 * Happiness Engineer
 * [5 years, 3 months ago](https://wordpress.org/support/topic/conditional-for-infinite-scroll/#post-14091737)
 * Could you please post your site URL here so that we can have a look?
 * If you want it to remain private, you can also contact us [via this contact form](https://jetpack.com/contact-support/?rel=support&hpi=1).
   If you choose to reach out directly, please include a link to this thread.
 * Thanks!
 *  Thread Starter [Rough Pixels](https://wordpress.org/support/users/roughpixels/)
 * (@roughpixels)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/conditional-for-infinite-scroll/#post-14091888)
 * I would post the URL, but I’m working on this locally on my computer via XAMPP.
 * Basically, I am looking for an “if/else” method to conditionally prevent the 
   blog navigation from loading if Infinite Scroll is enabled. My nav is based on:
 * the_posts_pagination();
 * …page numbered.
 *  Plugin Contributor [Stef (a11n)](https://wordpress.org/support/users/erania-pinnera/)
 * (@erania-pinnera)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/conditional-for-infinite-scroll/#post-14100536)
 * Hey [@roughpixels](https://wordpress.org/support/users/roughpixels/),
 * With no URL to check on this, it’s a bit tricky for us to troubleshoot your question
   🙂
 * However, can you check whether you have widgets in your footer at all? If you
   want posts to load as you scroll down, you can place widgets in an alternative
   widget area, such as the sidebar. If your theme has only footer widget areas,
   you may wish to look for a different theme with more widget area options.
 * Let me know if that’s your case – thanks!
 *  Thread Starter [Rough Pixels](https://wordpress.org/support/users/roughpixels/)
 * (@roughpixels)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/conditional-for-infinite-scroll/#post-14102482)
 * Thank you for the follow-up. However, I think you might have misunderstood my
   original request/question…
 * I’m not referring to the footer or widgets, but in my theme, I have numbered 
   pagination set up for navigating the bog (as in newer posts vs previous posts).
   The infinite scroll loads below that and the navigation is not nulled (removed).
 * In the PHP file for my index.php which has the structure of the blog layout, 
   the navigation is there (which uses the `the_posts_pagination();` method). Basically,
   I’m wondering if there is a PHP if/else statement that can be used to create 
   a conditional where the infinite scroll in Jetpack is enabled, the blog navigation
   won’t load.
 * …I’m not sure why seeing the front-end of the website is relevant when this is
   in relation to PHP coding for a conditional statement. Again, this has nothing
   to do with a footer or widgets.
 *  Plugin Contributor [Stef (a11n)](https://wordpress.org/support/users/erania-pinnera/)
 * (@erania-pinnera)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/conditional-for-infinite-scroll/#post-14114944)
 * Hi again, [@roughpixels](https://wordpress.org/support/users/roughpixels/),
 * > In the PHP file for my index.php which has the structure of the blog layout,
   > the navigation is there (which uses the the_posts_pagination(); method). Basically,
   > I’m wondering if there is a PHP if/else statement that can be used to create
   > a conditional where the infinite scroll in Jetpack is enabled, the blog navigation
   > won’t load.
 * Have you checked our [Infinite Scroll support page](https://jetpack.com/support/infinite-scroll/)
   about that?
 * There’s a snippet that hides the navigation links:
 *     ```
       /* Hides navigation links and site footer when infinite scroll is active */
       .infinite-scroll #navigation,
       .infinite-scroll.neverending #footer {
        display: none;
       }
       ```
   
 * But, again, as it’s tied with footer settings I’m not sure if this is something
   useful for you. Can you give it a look and let me know?
 * Thanks a lot for the cooperation and patience 🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Conditional for Infinite Scroll?’ is closed to new replies.

 * ![](https://ps.w.org/jetpack/assets/icon.svg?rev=2819237)
 * [Jetpack - WP Security, Backup, Speed, & Growth](https://wordpress.org/plugins/jetpack/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jetpack/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jetpack/)
 * [Active Topics](https://wordpress.org/support/plugin/jetpack/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jetpack/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jetpack/reviews/)

## Tags

 * [blog navigation](https://wordpress.org/support/topic-tag/blog-navigation/)

 * 5 replies
 * 3 participants
 * Last reply from: [Stef (a11n)](https://wordpress.org/support/users/erania-pinnera/)
 * Last activity: [5 years, 3 months ago](https://wordpress.org/support/topic/conditional-for-infinite-scroll/#post-14114944)
 * Status: resolved