Reposition Page Titles

Community Forums Forums Design Tips and Tricks Reposition Page Titles

This topic is: resolved

This topic contains 16 replies, has 4 voices, and was last updated by  Susan Nelson 1 year, 3 months ago.

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #45317

    Susan Nelson
    Participant
    Post count: 207

    URL: http://goo.gl/RETCu

    Can someone point me in the right direction on how to reposition the page titles? I need to have a background that extends the full width of the page and then have the page title appear inside that background. Like this: http://theme-fusion.com/avada/about-us/

    Thanks for any ideas!


    Susan Nelson | Oh, Hello Designs | Twitter | Facebook

    http://goo.gl/RETCu
    #45320

    Anita
    Blocked
    Post count: 7712

    Hi Susan, looking at their example – their Title is inside with the Breadcrumbs. Could you re-position it in the breadcrumb area and float the title to the left?

    #45321

    Anita
    Blocked
    Post count: 7712

    I did a Google search and found this also – http://twodinks.com/2012/04/02/move-titles-around-in-genesis/.

    #45322

    Susan Nelson
    Participant
    Post count: 207

    Well, that example is a non-Genesis theme. But no, I would like the page title to be completely above the content area AND the sidebar.

    Just saw your 2nd post – will take a look at that link. Thanks!


    Susan Nelson | Oh, Hello Designs | Twitter | Facebook

    #45334

    Susan Nelson
    Participant
    Post count: 207

    I’m not getting it right. Ideally, I would like to do something like this:

    [html]
    <div class="page-title">
    <div class="wrap">Page Title Here</div>
    </div>
    [/html]

    I would like .page-title to extend across the page with a background color. And then the .wrap would be a fixed width and centered on the page. A setup just like the #header…..

    Hmmm…


    Susan Nelson | Oh, Hello Designs | Twitter | Facebook

    #45348

    cdils
    Participant
    Post count: 421

    Thinking (typing) out loud here… Since the page title occurs inside the loop, you’ll have to add it outside the loop, which you can’t do with a regular hook alone.

    I’m thinking custom query to get the title then add it with a hook.


    Have you been helped in this forum? Pay it forward and answer someone else’s question. I bet you’ll know the answer to at least one question. :)

    I host a weekly Genesis-focused podcast called Genesis Office Hours. I tweet @cdils.

    #45349

    cdils
    Participant
    Post count: 421

    Is this for a single page or a bunch of pages?


    Have you been helped in this forum? Pay it forward and answer someone else’s question. I bet you’ll know the answer to at least one question. :)

    I host a weekly Genesis-focused podcast called Genesis Office Hours. I tweet @cdils.

    #45351

    Chris Cree
    Participant
    Post count: 147

    I think you’re going to have to do it in two steps. Try something like this:

    [php]// Move titles above the content sidebar wrap
    add_action( ‘genesis_before’, ‘wsm_move_title’ );
    function wsm_move_title() {
    if ( is_page() ) {
    remove_action( ‘genesis_post_title’, ‘genesis_do_post_title’ );
    add_action( ‘genesis_before_content_sidebar_wrap’, ‘wsm_show_page_title_text’, 2 );
    }
    }
    function wsm_show_page_title_text() {
    echo ‘<div class="top-title">’;
    echo ‘<h1>’ . get_the_title() . ‘</h1>’;
    echo ‘</div>’;
    }[/php]

    Then add the CSS for your new .top-title class as appropriate.


    #45352

    Susan Nelson
    Participant
    Post count: 207

    Hey Carrie! Thanks for sharing your thoughts. You lost me. haha But I want it for all the pages (not posts).

    Chris, thank you so much! I changed the hook to genesis_after_header and it’s almost perfect. The blog titles are now gone and I’m not sure how to get them back.


    Susan Nelson | Oh, Hello Designs | Twitter | Facebook

    #45356

    Anita
    Blocked
    Post count: 7712

    Wow, we got some of the cream of the crop coding going on in here! Thanks Carrie and Chris for jumping in here! :)

    #45367

    Chris Cree
    Participant
    Post count: 147

    Instead of

    [php]if ( is_page() ) {[/php]

    Try

    [php]if ( is_page() && !is_page_template( ‘page_blog.php’ ) ) {[/php]

    That should keep it from affecting your plog page. If it is affecting single posts add !is_single() like this

    [php]if ( ( is_page() && !is_page_template( ‘page_blog.php’ ) ) || !is_single() ) {[/php]


    • This reply was modified 1 year, 3 months ago by  Chris Cree.
    • This reply was modified 1 year, 3 months ago by  Chris Cree.
    • This reply was modified 1 year, 3 months ago by  Chris Cree.
    • This reply was modified 1 year, 3 months ago by  Chris Cree.
    #45368

    Chris Cree
    Participant
    Post count: 147

    Holy smokes! The forum butchered that code. Let me see if I can edit it…

    OK. That’s much better.


    • This reply was modified 1 year, 3 months ago by  Chris Cree.
    • This reply was modified 1 year, 3 months ago by  Chris Cree.
    #45372

    Susan Nelson
    Participant
    Post count: 207

    Interesting…

    URL to blog page: http://goo.gl/TGS3s

    This makes it so the blog posts titles show up, but the page title of Blog and the green background disappear:
    [php]if ( is_page() && !is_page_template( ‘page_blog.php’ ) ) {[/php]

    This is what I currently have and it allows the Blog page title and green background to show, but the posts titles disappear:
    [php]if ( ( is_page() && !is_page_template( ‘page_blog.php’ ) ) || !is_single() ) {[/php]

    And then on a single post, the Blog page title and green background are not there. (http://goo.gl/NaKwB)


    Susan Nelson | Oh, Hello Designs | Twitter | Facebook

    #45381

    Chris Cree
    Participant
    Post count: 147

    Silly me. The blog page template doesn’t have a page title in Genesis. So we don’t have to remove it there, just add it back in.

    TryTry this on for size.

    [php]// Move titles above the content sidebar wrap
    add_action( ‘genesis_before’, ‘wsm_move_title’ );
    function wsm_move_title() {
    if ( is_page() && !is_page_template( ‘page_blog.php’ ) {
    remove_action( ‘genesis_post_title’, ‘genesis_do_post_title’ );
    add_action( ‘genesis_after_header’, ‘wsm_show_page_title_text’, 2 );
    }
    elseif ( is_page_template( ‘page_blog.php’ ) ) {
    add_action( ‘genesis_after_header’, ‘wsm_show_page_title_text’, 2 );
    }
    }
    function wsm_show_page_title_text() {
    echo ‘<div class="top-title">’;
    echo ‘<h1>’ . get_the_title() . ‘</h1>’;
    echo ‘</div>’;
    }[/php]


    #45383

    Susan Nelson
    Participant
    Post count: 207

    Thank you SO much, Chris! I tried it, but I keep getting the white screen. I’m not quite sure where the error is. I fixed the & #038; & but that still didn’t do it.


    Susan Nelson | Oh, Hello Designs | Twitter | Facebook

    • This reply was modified 1 year, 3 months ago by  Susan Nelson.
    • This reply was modified 1 year, 3 months ago by  Susan Nelson.
Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in to reply to this topic.