Community Forums › Forums › Archived Forums › Design Tips and Tricks › keep post title while removing page title
Tagged: page-title, post title
- This topic has 12 replies, 3 voices, and was last updated 11 years, 7 months ago by
Boca.des.
-
AuthorPosts
-
September 12, 2014 at 6:26 am #124093
Boca.des
MemberI am using the blog template to display categories using query_args. I've added content above the blog template to describe each category.
How do I remove the page title but keep the post titles in the blog template? This is my code but its deleting the post titles as well?
add_action ('get_header', 'remove_page_titles_genesis'); function remove_page_titles_genesis() { if ( is_page_template('page_blog.php')) { remove_action('genesis_entry_header', 'genesis_do_post_title'); }}September 12, 2014 at 8:17 am #124099Brad Dalton
ParticipantLink to the source of your code please.
This tutorial explains how to remove or hide titles using PHP or CSS code.
Could you also link to the page you want to remove the title from. Thanks.
September 12, 2014 at 10:10 am #124120Boca.des
MemberSorry, my apologies - didn't realise till I sent it.
Original code:
add_action ('get_header', 'remove_page_titles_genesis'); /** * @author Brad Dalton * @example http://wpsites.net/ */ function remove_page_titles_genesis() { if ( is_page() || $post->post_parent ) { remove_action('genesis_entry_header', 'genesis_do_post_title'); }}Source of code: http://wpsites.net/best-plugins/hide-page-titles-genesis/
I can't send link to page as its not live yet, its unfinished.
I can't seem to hide the page titles but show post titles after reading the tutorial? - It just hides them all?
Thanks again
Ryan
RyanSeptember 12, 2014 at 10:21 am #124124Brad Dalton
ParticipantSeptember 12, 2014 at 10:39 am #124125Boca.des
MemberI have over 200 category pages - its a kind of listings site. I can't name each individual page id?
September 12, 2014 at 12:10 pm #124134Susan
ModeratorHave you looked at the Genesis Title Toggle plugin?
September 12, 2014 at 12:22 pm #124135Boca.des
MemberI'm using this for the pages that are not category ones. This plugin removes the post titles as well which I want to keep
September 12, 2014 at 1:23 pm #124144Brad Dalton
ParticipantSeptember 12, 2014 at 1:39 pm #124148Boca.des
MemberI've disabled the coming soon plugin for you to see ..
September 12, 2014 at 2:33 pm #124158Brad Dalton
ParticipantTry something like this:
.page-template-page_blog-php .entry-title { display: none; }I suggest you learn how to use Firebug if you're going to design your own site.
September 12, 2014 at 4:59 pm #124172Boca.des
MemberBoth of them share the .entry-title tag, so they are both disappearing - the only difference is the page title is not a link, and the post titles are. I've tried separating them but no joy, I may just have to keep the page title displayed - and add a more descriptive title in the Custom document title
.page-template-page_blog-php .entry-title { display: none; }' and.page-template-page_blog-php .entry-title a {
display: block;
}'September 13, 2014 at 12:36 am #124194Brad Dalton
ParticipantSeptember 13, 2014 at 6:50 am #124221Boca.des
MemberWill do thanks, thanks for the time and help.
-
AuthorPosts
- The topic ‘keep post title while removing page title’ is closed to new replies.