Community Forums › Forums › Archived Forums › General Discussion › remove blog page title without removing post titles
- This topic has 15 replies, 5 voices, and was last updated 8 years, 5 months ago by Gakuranman.
-
AuthorPosts
-
May 19, 2015 at 7:09 am #152743mel62Member
I have a site using a blog page template so that we could include info at the top of the blog page. I want to remove the page title on that blog page but everything I try removes the titles of the blog posts on that page as well.
Does anyone have the magic code?
May 19, 2015 at 7:57 am #152746SusanModeratorBill Erickson's Genesis Title Toggle plugin.
May 19, 2015 at 10:02 am #152761mel62MemberHi Susan, thank you.
We already have that installed and it removes all titles from the blog page, including the blog post titles.
May 20, 2015 at 11:42 am #152931mel62MemberCan someone help me with this please?
May 20, 2015 at 1:27 pm #152948SusanModeratorTake a look at this tutorial: http://www.rickrduncan.com/wordpress/remove-genesis-page-titles
May 21, 2015 at 5:42 am #153079mel62MemberThank you Susan!
I found the code offered in the comments and tried the code below but it isn't working. Do you know what I might be doing wrong?
add_action( ‘get_header’, ‘child_remove_titles’ ); function child_remove_titles() { if ( is_page_template(‘page_blog.php’) || $post->post_parent ) { remove_action( ‘genesis_entry_header’, ‘genesis_do_post_title’ ); }}
I'm still getting page and post titles on my blog page.
May 21, 2015 at 4:44 pm #153156GrahamMemberWhich blog page template are you using?
My JustGiving page: https://www.justgiving.com/helping-graham-give
May 22, 2015 at 1:16 am #153216mel62MemberJust a simple template, I believe I got it from a post by Brad Dalton. I'm using a template so that I can add text and an image to the top. I wasn't able to get it to work without a template.
//* Template Name: Blog //* The blog page loop logic is located in lib/structure/loops.php add_action('genesis_loop', 'genesis_standard_loop', 8); genesis();
May 22, 2015 at 6:54 am #153249Genesis DeveloperMemberFollowing code it is working for me. I added the code in page_blog.php file.
//* The blog page loop logic is located in lib/structure/loops.php add_action('genesis_loop', 'gd_blog_page_content', 8); function gd_blog_page_content() { remove_action('genesis_entry_header', 'genesis_do_post_title'); genesis_standard_loop(); add_action('genesis_entry_header', 'genesis_do_post_title'); } genesis();
May 27, 2015 at 4:59 am #153767mel62MemberThat didn't work for me for some reason. What is it doing for you exactly?
What I need is to remove the blog page title but not the titles of the posts in the loop.
May 27, 2015 at 5:51 am #153779Genesis DeveloperMemberAre you removed this line?
add_action('genesis_loop', 'genesis_standard_loop', 8);
May 27, 2015 at 10:22 am #153836mel62MemberThat took care of the blog page title, yes. But it also removed the content at the top of the page, which I need.
May 30, 2015 at 1:13 am #154188mel62MemberSo, is what I'm looking for not possible?
June 3, 2015 at 5:08 am #154690mel62MemberHello! I would really appreciate some help on this. 🙂
October 4, 2015 at 5:01 am #167369GakuranmanMemberI'm having the same problem. What is the specific hook to remove the blog page title but leave the post titles intact on the page?
For example, the following code in functions.php with remove titles from all pages and archive pages, but it does not work on the blog page. Tested on a fresh child theme Is this a bug?
add_action( 'get_header', 'child_remove_page_titles' );
function child_remove_page_titles() {
if ( is_page() || is_home() || is_archive() ) {
remove_action( 'genesis_before_loop', 'genesis_do_taxonomy_title_description', 15 );
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
}
}October 4, 2015 at 8:23 am #167383GakuranmanMemberFound the solution while browsing the Genesis source theme files. In archive.php we find:
genesis_do_posts_page_heading
Adding this line to the child theme removes the title from the Genesis posts page:
remove_action( 'genesis_before_loop', 'genesis_do_posts_page_heading' );
And of course, adding it back in a different place is just as easy:
add_action( 'genesis_before_content_sidebar_wrap', 'genesis_do_posts_page_heading' );
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.