Created
December 14, 2012 00:22
-
-
Save ramseyp/4281371 to your computer and use it in GitHub Desktop.
Inserting an exception into the conditionals for the page-title.php file in StudioPress's Minimum child theme
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
<?php | |
/** | |
* | |
* Modified page-title.php file for the Minimum child theme. | |
* | |
*/ | |
if ( is_home() ) { | |
echo '<div id="page-title"><div class="wrap"><p>' . esc_html( get_bloginfo( 'description' ) ) . '<a class="page-title-button" href="#">' . __( 'Subscribe Now', 'minimum' ) . '</a></p></div></div>'; | |
} | |
elseif ( is_404() ) { | |
echo '<div id="page-title"><div class="wrap"><p>' . __( 'Ooops!', 'minimum' ) . '<a class="page-title-button" href="#">' . __( 'Subscribe Now', 'minimum' ) . '</a></p></div></div>'; | |
} | |
elseif ( is_post_type_archive( 'portfolio' ) || is_singular( 'portfolio') ) { | |
echo '<div id="page-title"><div class="wrap"><p>' . __( 'From the Portfolio', 'minimum' ) . '<a class="page-title-button" href="#">' . __( 'Subscribe Now', 'minimum' ) . '</a></p></div></div>'; | |
} | |
elseif ( is_singular( 'page' ) ) { | |
echo '<div id="page-title"><div class="wrap"><p>' . esc_html( get_bloginfo( 'description' ) ) . '<a class="page-title-button" href="#">' . __( 'Subscribe Now', 'minimum' ) . '</a></p></div></div>'; | |
} | |
// after is_category(), we need to add the combination of the negative for the category to be excluded. Replace 'category-name' with your category slug. 'podcast', for example. | |
elseif ( is_author() || is_category() && !is_category( 'category-name' ) || is_date() || is_search() || is_singular() || is_tag() ) { | |
echo '<div id="page-title"><div class="wrap"><p>' . __( 'From the Blog', 'minimum' ) . '<a class="page-title-button" href="#">' . __( 'Subscribe Now', 'minimum' ) . '</a></p></div></div>'; | |
} | |
// since we excluded 'category-name' from the conditional above, we have to setup its own elseif statement. Replace 'From my Category' with what you want. | |
elseif ( is_category( 'category-name' ) ) { | |
echo '<div id="page-title"><div class="wrap"><p>' . __( 'From my Category', 'minimum' ) . '<a class="page-title-button" href="#">' . __( 'Subscribe Now', 'minimum' ) . '</a></p></div></div>'; | |
} | |
else { | |
echo '<div id="page-title"><div class="wrap"><p>' . esc_html( get_bloginfo( 'description' ) ) . '<a class="page-title-button" href="#">' . __( 'Subscribe Now', 'minimum' ) . '</a></p></div></div>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment