Community Forums › Forums › Archived Forums › Design Tips and Tricks › Help with Minimum 2.0 theme: page-title.php
- This topic has 8 replies, 3 voices, and was last updated 11 years ago by purplepatriot.
-
AuthorPosts
-
February 27, 2013 at 11:52 am #23132centologixMember
hi-
i have the tagline and button showing up on my front page, using this code:
if ( is_home() ) { echo '<div id="page-title"><div class="wrap"><p>' . esc_html( get_bloginfo( 'description' ) ) . '<a class="page-title-button" href="#">' . __( 'Shop 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="#">' . __( 'Shop 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="#">' . __( 'Shop 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="#">' . __( 'Shop Now', 'minimum' ) . '</a></p></div></div>'; } elseif ( is_author() || is_category() || 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="#">' . __( 'Shop 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="#">' . __( 'Shop Now', 'minimum' ) . '</a></p></div></div>'; }</code>
how do i:
1. make it so that this does not show up for certain pages (say a contact page)?
2. how do i move it around the page? right now it is showing up on all pages just above the in-page title. of course, i want to keep it in the same position for the front page.
thank yo
April 12, 2013 at 8:53 am #34997purplepatriotMemberhi centologix,
I'm just getting back into the forums after the switchover. I was dealing with this issue recently, so thought I would share my experience.
Say that your contact page has id=42. Then, you could add this code after the last 'elseif' block but before the final 'else' block, so it would look something like:
... elseif ( is_author() || is_category() || is_date() || is_search() || is_tag() ) { echo '</code> <div id="page-title"><div class="wrap">' . __( 'From the Blog', 'minimum' ) . '<a class="page-title-button" href="#">' . __( 'Shop Now', 'minimum' ) . '</a></div></div>'; } elseif ( is_page('42') ) { echo ''; } else { echo '<div id="page-title"><div class="wrap">' . esc_html( get_bloginfo( 'description' ) ) . '<a class="page-title-button" href="#">' . __( 'Shop Now', 'minimum' ) . '</a></div></div>'; }
Give that a try and let me know how it works.
Eric @ Coolwater Creative – “Take a leap. Make a splash. Ripple the pond.”
“Never sacrifice the permanent on the altar of the immediate.” – Give back and help out in the forums.April 24, 2013 at 3:20 pm #37467kwikkopydcMemberTrying to accomplish same thing. Using is_page('[id]') doesn't seem to work for me. Any other ideas?
April 25, 2013 at 10:46 am #37676purplepatriotMemberHi kwikkopydc - try removing the single quotes around the page id number.
Eric @ Coolwater Creative – “Take a leap. Make a splash. Ripple the pond.”
“Never sacrifice the permanent on the altar of the immediate.” – Give back and help out in the forums.April 25, 2013 at 1:04 pm #37704kwikkopydcMemberHi purplepatriot -- no change when the single quotes are removed
http://animatedcatalogs.com/features-and-benefits/
April 26, 2013 at 7:59 am #37834purplepatriotMemberYeah, I figured that would be the case, but needed to rule it out. Can you post your entire page-title.php here so I can review it? Thanks!
Eric @ Coolwater Creative – “Take a leap. Make a splash. Ripple the pond.”
“Never sacrifice the permanent on the altar of the immediate.” – Give back and help out in the forums.April 26, 2013 at 8:04 am #37835purplepatriotMemberActually, try this first. Take the elseif conditional with the specific page-id (is_page( XX ) ) and move it just above the elseif (is_singular( 'page' )) condition. Since your page matches the is_singular('page') condition first, it leaves the loop at that point and doesn't get to the page-specific condition.
Eric @ Coolwater Creative – “Take a leap. Make a splash. Ripple the pond.”
“Never sacrifice the permanent on the altar of the immediate.” – Give back and help out in the forums.April 26, 2013 at 8:19 am #37839kwikkopydcMemberI figured it was something like that... this solved my issue.
For the record, the solution was without the single quotes and moving the is_page([#]) before the is_singular( 'page') in the sequence of else if statements. Thx.
April 26, 2013 at 8:24 am #37842purplepatriotMemberGlad I could help!
Eric @ Coolwater Creative – “Take a leap. Make a splash. Ripple the pond.”
“Never sacrifice the permanent on the altar of the immediate.” – Give back and help out in the forums. -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.