Skip to content

Instantly share code, notes, and snippets.

@ramseyp
Created December 14, 2012 00:22
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 ramseyp/4281371 to your computer and use it in GitHub Desktop.
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
<?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