Last active
March 4, 2022 12:21
-
-
Save gnomezgrave/a85e32b7f42c7589a729e72dbf3e71ed to your computer and use it in GitHub Desktop.
Hide WordPress Cali Theme Category Posts Slider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
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