Community Forums › Forums › Archived Forums › Design Tips and Tricks › Removing Page Titles | Pretty Pictures Theme
Tagged: page titles, pretty pictures
- This topic has 29 replies, 7 voices, and was last updated 10 years, 11 months ago by Brad Dalton.
-
AuthorPosts
-
January 22, 2013 at 3:01 pm #13839KBordonaroMember
Hi!
I used the following code but the page titles are still there.
/** Remove page titles */
add_action( ‘get_header’, ‘child_remove_page_titles’ );
function child_remove_page_titles() {
if ( is_page() && ! is_page_template( ‘page_blog.php’ ) )
remove_action( ‘genesis_post_title’, ‘genesis_do_post_title’ );
}Help! 🙂
Kimberly
January 22, 2013 at 3:31 pm #13852Brad DaltonParticipantI've written a tutorial on this as there's different ways to hide page titles in WordPress themes.
Where did you get the php for this?
January 22, 2013 at 3:38 pm #13853KBordonaroMemberThanks, Brad. Great tutorial!
I'm wondering if there is a way to remove titles from all my websites pages instead of doing it one by one for specific pages. I remember I did this on a previous child theme I used but I don't recall how.
BTW, I got the code from searching on this forum. There are quite a few posts, not sure which one I grabbed it from - but it was used in a few of them.
Cheers,
Kimberly
January 22, 2013 at 3:46 pm #13856Brad DaltonParticipantBills plugin: Genesis Title Toggle
http://wordpress.org/extend/plugins/genesis-title-toggle/Haven't tested this plugin but it should do the job based on the description.
January 22, 2013 at 4:43 pm #13877SoZoMemberDelete this line
add_action( ‘genesis_post_title’, ‘genesis_do_post_title’ );
from
// Add back, as post has no format
else {
add_action( ‘genesis_before_post_content’, ‘genesis_post_info’ );
add_action( ‘genesis_post_title’, ‘genesis_do_post_title’ );
add_action( ‘genesis_after_post_content’, ‘genesis_post_meta’ );
}
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 22, 2013 at 4:59 pm #13892KBordonaroMember@SoZo... I don't see the snippet. Here's what I have:
/** Remove elements for post formats */
add_action( 'genesis_before_post', 'pp_remove_elements' );
function pp_remove_elements() {// Remove if post has quote format
if ( has_post_format( 'quote' ) ) {
remove_action( 'genesis_before_post_content', 'genesis_post_info' );
remove_action( 'genesis_post_title', 'genesis_do_post_title' );
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
}// Remove if post has gallery format
elseif ( has_post_format( 'gallery' ) ) {
add_action( 'genesis_post_title', 'genesis_do_post_title' );
add_action( 'genesis_after_post_content', 'genesis_post_meta' );
}// Add back, as post has no format
else {
add_action( 'genesis_post_title', 'genesis_do_post_title' );
add_action( 'genesis_after_post_content', 'genesis_post_meta' );
}
@Brad - excellent plugin... except it also removed my header picture on the blog post pages. Strange!January 22, 2013 at 5:00 pm #13893SoZoMemberThe last one 😉
// Add back, as post has no format
else {
add_action( ‘genesis_post_title’, ‘genesis_do_post_title’ );
add_action( ‘genesis_after_post_content’, ‘genesis_post_meta’ );
}
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 22, 2013 at 5:07 pm #13898KBordonaroMemberHmmmm....
That removes my header picture whenever I'm on a blog page.
My "about", "contact", and "amplify your brand" pages have my header picture.
The "homepage", "brandspiration" and "praise" pages (all blog formats) don't.
http://www.kimberlybordonaro.com
January 22, 2013 at 6:01 pm #13915SoZoMemberOk, put that line back and then use this (not sure why but I wrote it out from scratch instead of copy/pasting and it's working for me)
/** Remove page titles */ add_action('get_header', 'child_remove_page_titles'); function child_remove_page_titles() { if (is_page() && ! is_page_template( ‘page_blog.php’ ) ) remove_action('genesis_post_title', 'genesis_do_post_title'); }
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 22, 2013 at 7:56 pm #13954KBordonaroMemberI don't get it...
I did exactly as you said and put back the original code, but it is still taking out my header image on blog page, including the front page.
January 22, 2013 at 7:59 pm #13955KBordonaroMemberOkay, I redid it. Now the header image is back to normal...
But, the added code isn't removing the page titles.
🙁
January 22, 2013 at 8:00 pm #13956KBordonaroMemberPS, You are so awesome John. I really appreciate your help.
January 22, 2013 at 8:57 pm #13967docmasMemberi added the title toggler plugin to do the same thing on my agency blog:
it works, yet not sure if the added plugin slows down loading or just changes the php once for each page.
adam
January 23, 2013 at 6:35 am #14032Brad DaltonParticipant'@Brad – excellent plugin… except it also removed my header picture on the blog post pages. Strange!'
l'll pass that onto Bill Erickson who's the plugin author because it shouldn''t do that.
January 23, 2013 at 10:36 pm #14237KBordonaroMemberThanks, Brad.
If anyone has suggestions on how to the resolve this issue, please chime in. I'd greatly appreciate it. 🙂
January 31, 2013 at 9:34 pm #16964khawaja1971MemberI would also like this to be resolved. If I use the Genesis Title Toggle plugin I can remove the title from my home "page". But if I put the following code at the end of home.php in Balance theme it has no effect.
remove_action( 'genesis_post_title', 'genesis_do_post_title' );
From everything I read it really should work. I`ve also tried the whole functions.php thing as well to no avail. There is a whole bunch of white space I would really like to remove to make the home page a bit more voter / mobile friendly.
February 12, 2013 at 9:31 am #19824Brad DaltonParticipantIs this resolved now?
Here's a good tutorial on removing titles using conditional tags
February 12, 2013 at 11:10 am #19845khawaja1971MemberMore ignored rather than resolved. I've put the code in various different places including functions.php and home.php without effect.
February 12, 2013 at 6:27 pm #19968KBordonaroMemberHi, Brad.
I used the code for removing page titles... but now it's removed the blog post titles on the blog page.
So frustrating!
Any ideas on what to do?
Kimberly
February 14, 2013 at 3:48 am #20268Brad DaltonParticipantRemove this code from your child themes functions file if you are NOT using or planning on using post formats.
Backup the file first.
/** Add support for post formats */ add_theme_support( 'post-formats', array( 'gallery', 'quote' ) ); /** Remove elements for post formats */ add_action( 'genesis_before_post', 'pp_remove_elements' ); function pp_remove_elements() { // Remove if post has quote format if ( has_post_format( 'quote' ) ) { remove_action( 'genesis_before_post_content', 'genesis_post_info' ); remove_action( 'genesis_post_title', 'genesis_do_post_title' ); remove_action( 'genesis_after_post_content', 'genesis_post_meta' ); } // Remove if post has gallery format elseif ( has_post_format( 'gallery' ) ) { add_action( 'genesis_post_title', 'genesis_do_post_title' ); add_action( 'genesis_after_post_content', 'genesis_post_meta' ); } // Add back, as post has no format else { add_action( 'genesis_before_post_content', 'genesis_post_info' ); add_action( 'genesis_post_title', 'genesis_do_post_title' ); add_action( 'genesis_after_post_content', 'genesis_post_meta' ); } }
Then add this code to the end of your child themes functions.php file.
This will remove the page titles from all single pages. You can change the conditional tag to remove titles from other pages, posts etc.
//remove page titles only sitewide add_action('get_header', 'child_remove_page_titles'); function child_remove_page_titles() { if ( is_page() ) { remove_action('genesis_post_title', 'genesis_do_post_title'); } }
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.