Introducing Solo Pine Mods | An affordable & reliable way to customize your theme

Okay
  Print

Hide Featured Area on subsequent (paginated) homepage/blog pages

On your homepage or blog pages (whichever displays your postfeed), when you click the "Older Posts" button, you will be taken to another page which displays even more of your posts. By default, if you have the Featured Area set to display, it will also display on these subsequent pages. 

To only have the Featured Area display on that first homepage/blog page but not the other pages, we can make a small adjustment to the code. 



LAUREL

Navigate to WP Dashboard > Appearance > Editor > and open the file titled "index.php"

On Line 3, you'll see:

<?php if(get_theme_mod( 'laurel_featured_slider' ) == true) : ?>

You can replace that line of code with the following code instead:

<?php if(get_theme_mod( 'laurel_featured_slider' ) == true && !is_paged()) : ?>

Additionally, to hide the Promo Boxes from displaying on subsequent homepage/blog pages, you can then look to Line 7. You'll see:

<?php if(get_theme_mod( 'laurel_promo' ) == true) : ?>

You can replace that line of code with the following:

<?php if(get_theme_mod( 'laurel_promo' ) == true && !is_paged()) : ?>

Save changes to the file when finished. 



SPROUT & SPOON


Navigate to WP Dashboard > Appearance > Editor > and open the file titled "index.php"

On Line 3, you'll see:

<?php if(get_theme_mod( 'sprout_spoon_featured_slider' ) == true) : ?>

You can replace that line of code with the following code instead:

<?php if(get_theme_mod( 'sprout_spoon_featured_slider' ) == true && !is_paged()) : ?>

Additionally, to hide the Homepage Widget beneath the Featured Area from displaying on subsequent homepage/blog pages, you can then look to Line 8. You'll see:

<?php if(is_active_sidebar('sidebar-3')) : ?>

You can replace that line of code with the following:

<?php if(is_active_sidebar('sidebar-3') && !is_paged()) : ?>

Save changes to the file when finished. 



REDWOOD


Navigate to WP Dashboard > Appearance > Editor > and open the file titled "index.php"

On Line 7, you'll see:

<?php if(get_theme_mod( 'sp_featured_slider' ) == true) : ?>

You can replace that line of code with the following code instead:

<?php if(get_theme_mod( 'sp_featured_slider' ) == true && !is_paged()) : ?>

Additionally, to hide the Promo Boxes beneath the Featured Area Slider from displaying on subsequent homepage/blog pages, you can then look to Line 11. You'll see:

<?php if(get_theme_mod( 'sp_promo' ) == true) : ?>

You can replace that line of code with the following:

<?php if(get_theme_mod( 'sp_promo' ) == true && !is_paged()) : ?>

Save changes to the file when finished.


 

ROSEMARY


Navigate to WP Dashboard > Appearance > Editor > and open the file titled "index.php"

On Line 5, you'll see:

<?php if(get_theme_mod( 'sp_featured_slider' ) == true) : ?>

You can replace that line of code with the following code instead:

<?php if(get_theme_mod( 'sp_featured_slider' ) == true && !is_paged()) : ?>

Save changes to the file when finished. 



ALDER


Navigate to WP Dashboard > Appearance > Editor > and open the file titled "index.php"

On Line 3, you'll see:

<?php if(get_theme_mod('alder_featured_slider')) : ?>

You can replace that line of code with the following code instead:

<?php if(get_theme_mod('alder_featured_slider') && !is_paged()) : ?>

Additionally, to hide the Homepage Widget beneath the Featured Area from displaying on subsequent homepage/blog pages, you can then look to Line 7. You'll see:

<?php if(is_active_sidebar('sidebar-4')) : ?>

You can replace that line of code with the following:

<?php if(is_active_sidebar('sidebar-4') && !is_paged()) : ?>

Save changes to the file when finished. 



HEMLOCK


Navigate to WP Dashboard > Appearance > Editor > and open the file titled "index.php"

On Line 3, you'll see:

<?php if(get_theme_mod( 'sp_featured_slider' ) == true) : ?>

You can replace that line of code with the following code instead:

<?php if(get_theme_mod( 'sp_featured_slider' ) == true && !is_paged()) : ?>

Save changes to the file when finished.



OLEANDER


Navigate to WP Dashboard > Appearance > Editor > and open the file titled "index.php"

On Line 3, you'll see:

<?php if(get_theme_mod( 'sp_featured_slider' ) == true) : ?>

You can replace that line of code with the following code instead:

<?php if(get_theme_mod( 'sp_featured_slider' ) == true && !is_paged()) : ?>

Additionally, to hide the Promo Boxes beneath the Featured Area Slider from displaying on subsequent homepage/blog pages, you can then look to Line 7. You'll see:

<?php if(get_theme_mod( 'sp_promo' ) == true) : ?>

You can replace that line of code with the following:

<?php if(get_theme_mod( 'sp_promo' ) == true && !is_paged()) : ?>

Save changes to the file when finished.