Community Forums › Forums › Archived Forums › Design Tips and Tricks › moved post/page titles, post titles disappeared on archive page
Tagged: archive page, page titles, post titles
- This topic has 5 replies, 2 voices, and was last updated 8 years, 2 months ago by dmcleod87.
-
AuthorPosts
-
March 14, 2016 at 12:14 am #181380dmcleod87Member
hi everyone,
i have re-positioned the page/post titles and breadcrumbs to the 'genesis_after_header' hook using the below snippet , this is so that i can create a full width banner behind the title. the problem i have is that since i have removed the 'genesis_entry_header', on the posts page as designated in the WordPress Reading settings, the posts titles don't appear, just the archive page title. on the singular post page it works fine.
working on the site from my local machine so no URL to show you what i'm talking about, hopefully the above is enough to go on. can someone point me in the right direction please! thanks!
//* Remove the entry title remove_action( 'genesis_entry_header', 'genesis_do_post_title' ); //* Remove the entry header markup remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 ); remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 ); //* Move the entry header markup and entry title before the content on all pages except the front page add_action( 'genesis_after_header', 'wp_add_entry_header' ); function wp_add_entry_header() { if (is_front_page()) { return; } elseif (is_home()) { return; } genesis_entry_header_markup_open(); genesis_do_post_title(); genesis_entry_header_markup_close(); } //* Move Archive page title before content remove_action( 'genesis_before_loop', 'genesis_do_posts_page_heading' ); add_action( 'genesis_after_header', 'genesis_do_posts_page_heading' ); //* Reposition the Genesis breadcrumb below entry title remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' ); add_action( 'genesis_after_header', 'genesis_do_breadcrumbs' );
March 18, 2016 at 11:48 pm #181836dmcleod87Memberno ideas on this problem? here is a screenshot to help visualise what i'm referring to - screenshot
any help would be greatly appreciated!
July 21, 2016 at 4:15 pm #189966pvananiaMemberDid you figure out a solution? I am having the same problem.
July 21, 2016 at 7:59 pm #189981dmcleod87Memberno sorry i never did figure it out...i've deleted the screenshot link by accident too...if i remember i'll post another later in case someone comes across a solution.
July 22, 2016 at 8:34 am #190004pvananiaMemberHey this worked for me (thanks to Bill Erickson)
function be_page_header() {
$title = false;
if( is_singular() && ! is_page_template( 'page_blog.php' ) ) {
$title = get_the_title();
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
}if( is_home() || is_archive() || is_page_template( 'page_blog.php' ))
$title = 'Blog';if( is_search() )
$title = 'Search results for: ' . get_search_query();if( $title )
echo '<div class="page-header"><div class="wrap"><h1>' . $title . '</h1></div></div>';
}
add_action( 'genesis_after_header', 'be_page_header' );July 24, 2016 at 12:47 pm #190035dmcleod87Memberthanks for sharing...glad it worked for you but unfortunately that wasn't the solution i was after.
with my original code above, this is what the posts page currently looks like.. It has the page title in the banner, but the post title is missing, it should be in the space above the date. in this screenshot of the individual post page, the title is in the banner as it should be.
can anyone point out what i'm doing wrong? adding
add_action( 'genesis_entry_header', 'genesis_do_post_title' );
adds the post title back in as seen here but then it's duplicated on normal pages as seen here -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.