Skip to content

Instantly share code, notes, and snippets.

@gnomezgrave
Last active March 4, 2022 12:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gnomezgrave/a85e32b7f42c7589a729e72dbf3e71ed to your computer and use it in GitHub Desktop.
Save gnomezgrave/a85e32b7f42c7589a729e72dbf3e71ed to your computer and use it in GitHub Desktop.
Hide WordPress Cali Theme Category Posts Slider
/**
The setting "cali_post_slider_hide_cat" is saved in the Post Slider section, but it's never used.
So, we need to extract the value in the header.php
Add the below condition to the if clause along with `is_home()`.
```
!get_theme_mod('cali_post_slider_hide_cat', false) &&
```
*/
<div id="content" class="site-content"><!-- ends in footer.php -->
<?php
// include post slider on home.php ie. blog post home page
// this adds the slider only when the setting is off.
// change the default value as you wish (either `true` or `false`.
if ( !get_theme_mod('cali_post_slider_hide_cat', false) && is_home() ) :
get_template_part( 'template-parts/content', 'slider_article' );
endif;
...
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment