Community Forums › Forums › Archived Forums › Design Tips and Tricks › Remove PAGE titles only
Tagged: remove page titles
- This topic has 12 replies, 3 voices, and was last updated 10 years, 8 months ago by worldviewpr.
-
AuthorPosts
-
August 18, 2013 at 7:55 pm #57253worldviewprMember
I've seen queries about removing post and page titles with the answer to use this snippet.
remove_action('genesis_post_title', 'genesis_do_post_title');
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
BUT...I just want the title of PAGES removed from the Content. I don't need ABOUT at top of its page when it's already been clicked in the NAV menu. All I can find is solutions to remove titles from eveything posts and pages.
http://redpark.wpengine.comAugust 18, 2013 at 8:37 pm #57258SusanModeratorIf you're not opposed to a plugin, try the Genesis Title Toggle. It allows you to select on a per page basis.
August 19, 2013 at 3:33 pm #57427worldviewprMemberHi Susan, thank you for the suggestion. No I don't mind plugins as long as they make a difference for the site and don't break anything<LOL>
I have tried Genesis Title Toggle with mixed success. I did ask it to turn off titles in a page and it did, but as the page included a query for some posts, it also removed the headlines of those posts. Perhaps it's wroth anopther look.
I need something that can be more specific. I just want the PAGE names (titles) showing up only in the NAV menu, tnot their page content.
August 19, 2013 at 4:52 pm #57437Brad DaltonParticipantAugust 19, 2013 at 4:57 pm #57438worldviewprMemberInteresting, thanks.
Question, would I then enter the page IDs separated by commas in the$pages = array ( nnnnn,yyyyy ); to select the pages where I want that function to apply, yes?
August 19, 2013 at 4:59 pm #57439worldviewprMemberI saw the CSS to at
http://wpsites.net/web-design/remove-titles-specific-conditions/
Is CSS the better way to do that instead of using display none? (possible google ding for hiding content?)
August 19, 2013 at 5:02 pm #57440Brad DaltonParticipantThat's right.
Or use CSS code:
.page .entry-title { display: none; }
You could also use the page i.d's using CSS:
.page-id-006 .entry-title, .page-id-007 .entry-title, .page-id-008 .entry-title, .page-id-009 .entry-title { display: none; }
Note: This CSS code uses the new HTML 5 class selectors and not the old XHTML selectors.
Both methods remove the title however both remove in the source code which is what the search engines scan.
August 19, 2013 at 5:09 pm #57443Brad DaltonParticipantAugust 19, 2013 at 5:10 pm #57444worldviewprMemberThe PHP did not work per http://redpark.wpengine.com/shop/
SHOP stil appears in contetn. SO far on most of the pages I could select Blog Template because I was using a query arg
but I am having no luck getting PHP to work, will try CSS and report
add_action('get_header', 'wpsites_remove_page_titles');
/**
* Removes Page Titles Based on i.d's in an array
* @author Brad Dalton - WP Sites
* @example http://wpsites.net/web-design/remove-titles-specific-conditions/
*/
function wpsites_remove_page_titles() {
$pages = array( 13,159,59,15,16 );
if ( is_page($pages) ) {
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
}
}August 19, 2013 at 5:17 pm #57447worldviewprMemberCSS did not work either per same URL
http://redpark.wpengine.com/shop/
.page-id-013 .entry-title,
.page-id-159 .entry-title,
.page-id-059 .entry-title,
.page-id-015 .entry-title,
.page-id-016 .entry-title {
display: none;
}It's a mystery. Possible host blocking something?
August 19, 2013 at 5:18 pm #57448Brad DaltonParticipantPlease read the note at the bottom of this thread.
I tested the PHP code and it worked perfectly.
Is your theme running HTML 5 or XHTML?
I also tested the CSS as well.
The CSS code also uses the new HTML 5 class selectors.
Neither the PHP or CSS code will work on sites using the old XHTML markup.
It only works on HTML 5 enabled sites
August 19, 2013 at 5:22 pm #57449worldviewprMemberI saw it work right on firefox so it must have been safari cache, even though I reset cache and restarted after it choked it still shows the page title. SO Iwill see if the php works, too again, thanks, but may just stick with the .css with html5 selectors
August 19, 2013 at 5:23 pm #57450worldviewprMemberThanks so much, I've been pounding my head on a wall for days on this.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.