Help with Minimum 2.0 theme: page-title.php

Community Forums Forums Design Tips and Tricks Help with Minimum 2.0 theme: page-title.php

This topic is: resolved

This topic contains 8 replies, has 3 voices, and was last updated by  purplepatriot 1 year, 8 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #23132

    centologix
    Participant

    hi-

    i have the tagline and button showing up on my front page, using this code:

    [php]
    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>
    [/php]

    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

    #34997

    purplepatriot
    Participant
    Post count: 38

    hi 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:

    [php]

    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>';
    }[/php]

    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.

    #37467

    kwikkopydc
    Participant
    Post count: 4

    Trying to accomplish same thing. Using is_page(‘[id]’) doesn’t seem to work for me. Any other ideas?

    #37676

    purplepatriot
    Participant
    Post count: 38

    Hi 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.

    #37704

    kwikkopydc
    Participant
    Post count: 4

    Hi purplepatriot — no change when the single quotes are removed

    http://animatedcatalogs.com/features-and-benefits/

     

    #37834

    purplepatriot
    Participant
    Post count: 38

    Yeah, 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.

    #37835

    purplepatriot
    Participant
    Post count: 38

    Actually, 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.

    #37839

    kwikkopydc
    Participant
    Post count: 4

    I 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.

    #37842

    purplepatriot
    Participant
    Post count: 38

    Glad 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.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.