Community Forums › Forums › Archived Forums › Design Tips and Tricks › Reposition Page Titles
Tagged: reposition page titles
- This topic has 16 replies, 4 voices, and was last updated 10 years, 9 months ago by Susan Nelson.
-
AuthorPosts
-
June 11, 2013 at 12:00 pm #45317Susan NelsonParticipant
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!
http://goo.gl/RETCuJune 11, 2013 at 12:10 pm #45320AnitaKeymasterHi 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?
Love coffee, chocolate and my Bella!
June 11, 2013 at 12:11 pm #45321AnitaKeymasterI did a Google search and found this also - http://twodinks.com/2012/04/02/move-titles-around-in-genesis/.
Love coffee, chocolate and my Bella!
June 11, 2013 at 12:12 pm #45322Susan NelsonParticipantWell, 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!
June 11, 2013 at 1:16 pm #45334Susan NelsonParticipantI'm not getting it right. Ideally, I would like to do something like this:
<div class="page-title"> <div class="wrap">Page Title Here</div> </div>
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...
June 11, 2013 at 2:31 pm #45348cdilsParticipantThinking (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 WordPress-focused podcast called Office Hours. I tweet @cdils.
June 11, 2013 at 2:36 pm #45349cdilsParticipantIs 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 WordPress-focused podcast called Office Hours. I tweet @cdils.
June 11, 2013 at 2:55 pm #45351Chris CreeParticipantI think you're going to have to do it in two steps. Try something like this:
// 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>'; }
Then add the CSS for your new .top-title class as appropriate.
June 11, 2013 at 3:33 pm #45352Susan NelsonParticipantHey 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.
June 11, 2013 at 4:08 pm #45356AnitaKeymasterWow, we got some of the cream of the crop coding going on in here! Thanks Carrie and Chris for jumping in here! 🙂
Love coffee, chocolate and my Bella!
June 11, 2013 at 5:58 pm #45367Chris CreeParticipantInstead of
if ( is_page() ) {
Try
if ( is_page() && !is_page_template( 'page_blog.php' ) ) {
That should keep it from affecting your plog page. If it is affecting single posts add !is_single() like this
if ( ( is_page() && !is_page_template( 'page_blog.php' ) ) || !is_single() ) {
June 11, 2013 at 5:58 pm #45368Chris CreeParticipantHoly smokes! The forum butchered that code. Let me see if I can edit it...
OK. That's much better.
June 11, 2013 at 6:12 pm #45372Susan NelsonParticipantInteresting...
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:
if ( is_page() && !is_page_template( 'page_blog.php' ) ) {
This is what I currently have and it allows the Blog page title and green background to show, but the posts titles disappear:
if ( ( is_page() && !is_page_template( 'page_blog.php' ) ) || !is_single() ) {
And then on a single post, the Blog page title and green background are not there. (http://goo.gl/NaKwB)
June 11, 2013 at 7:08 pm #45381Chris CreeParticipantSilly 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.
// 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>'; }
June 11, 2013 at 8:11 pm #45383Susan NelsonParticipantThank 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.
June 12, 2013 at 5:10 am #45414Susan NelsonParticipantGood morning!
I had to move this over to my development server because I didn't want the client to see it while we're trying to figure this out. So, the link is now http://clients.ohhellodesigns.com/rmedia/
I didn't notice this yesterday, but the latest blog post title is being added to the home page. And this is my current code:
// 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' ) ) || !is_single() ) { remove_action( 'genesis_post_title', 'genesis_do_post_title' ); add_action( 'genesis_after_header', 'wsm_show_page_title_text', 2 ); } } function wsm_show_page_title_text() { echo '<div class="top-title">'; echo '<div class="wrap">'; echo '<h1>' . get_the_title() . '</h1>'; echo '</div>'; echo '</div>'; }
June 13, 2013 at 7:23 am #45651Susan NelsonParticipantChris, thanks again SO MUCH for all your help! This code works perfectly:
// 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 '<div class="wrap">'; echo '<h1>' . get_the_title() . '</h1>'; echo '</div>'; echo '</div>'; }
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.