Community Forums › Forums › Archived Forums › Design Tips and Tricks › No page title on blog archives
- This topic has 13 replies, 4 voices, and was last updated 9 years, 9 months ago by Vejper.
-
AuthorPosts
-
June 24, 2014 at 7:32 am #111283VejperMember
I wanted to have some content above my default blog entries page so I use this code:
<?php //* Template Name: Blog //* Show page content above posts add_action( 'genesis_loop', 'genesis_standard_loop', 5 ); genesis();
But then I get the page name/title above it also as following example.
* Page Name
* Page Content
* Blog PostsAnd I tried using following code to remove * Page Name
//* Remove page titles site wide (posts & pages) (requires HTML5 theme support) remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
But then all the blog posts titles get removed also wich I don't want so how can I remove only the page title but not posts titles?
June 24, 2014 at 5:35 pm #111365Victor FontModeratorYou need a custom function in your functions.php file where you can conditionally filter by page ID. Here is the code I use on my sites:
//* Remove page title for a specific page (requires HTML5 theme support) //* Change '28' to your page id add_action( 'get_header', 'child_remove_page_titles' ); function child_remove_page_titles() { //* 354 = //* 519 = Leadership Framework //* 1149 = Training Registration //* 3545 = Resume/CV //* 4544 = Welcome Back //* 1754 = Plugin Defect Form $pages = array( 354,519,1149,1754,3545,4544 ); if ( is_page( $pages ) ) { remove_action( 'genesis_entry_header', 'genesis_do_post_title' ); } }
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?June 24, 2014 at 8:59 pm #111379jodzeeeMemberI've struggled with this in the past and found a variety of ways to do it. I'm still not sure what the "right" or best way is. If I just want to remove titles, I use this plugin:
http://wordpress.org/plugins/genesis-title-toggle/
This thread has some links and explanation of when I tried to figure it out. Hopefully it's helpful.
http://www.studiopress.community/topic/adding-content-to-top-andor-bottom-of-blog-page/
June 25, 2014 at 1:19 am #111405VejperMember@vfontjr
What I see is a code that will do exactly the same thing and remove the titles of all posts in the list on that page anyway aswell as the page title.
@jodzeee
Tried that plugin but it does exactly the same as my code that I used already and for the thread you linked me too it doesn't seem to have any answers about this since the same problem will arise with those plugins.June 25, 2014 at 1:54 am #111417jodzeeeMemberI guess I'm not entirely sure what you're trying to accomplish.
Another way I've done what I *think* you're looking for is with this plugin:
http://wordpress.org/plugins/posts-in-page/Or by using a category archive and adding the intro text there.
http://sridharkatakam.com/category-archive-headline-intro-text-genesis/June 25, 2014 at 2:14 am #111423VejperMemberThe posts in page plugin will not work.
What I mean is when I activate so I can have content above the blog posts list I get the following page:
Page Name
Content
Post Title #1
Post Content #1
Post Title #2
Post Content #2and so on and I want to remove Page Name but when I do that with either the code or the plugin then all the Post Titles disappear aswell.
The category archive isn't really what I want since I have a page named Blog that I use the Blog template for so I have all the blog posts listed there so the category intro text isn't going to show unless I am on a category archive page.
I hope I succeeded in making it a little bit more clear what my problem is.
June 25, 2014 at 10:01 pm #111577jodzeeeMemberI didn't realize the plugin would affect all titles and not just the page title.
An easy hack would be to hide the page title using CSS. I tried it on one of mine and it works ... it's H1 and the post titles are H2 so you can target just the page title.
June 26, 2014 at 2:12 am #111598Brad DaltonParticipantTry something like this:
.page-template-page_blog-php .archive-description {
display: none;
}
June 30, 2014 at 6:19 am #112084VejperMemberGot it solver by using this code:
.post-36 .entry-header { display: none; }
The page is id 36 obviously so thanks for the help but I am still looking for a better and cleaner way of doing this in the template file or something instead so it disappear completely and not even left in the source code, any other suggestions?
June 30, 2014 at 7:51 am #112090Brad DaltonParticipantJuly 1, 2014 at 1:02 am #112323VejperMember@braddalton Thanks but once again everything on that page either removes the title from the page and all blog posts listed on that page or none of the titles get removed.
July 1, 2014 at 2:16 am #112343VejperMemberThanks for trying to help me with this problem but I succeeded in fixing it by remove the content code from my first post and instead used an hook and a function with the content I wanted above all the posts on that page and by doing that eliminating the page title completely 🙂
July 1, 2014 at 2:34 am #112345Brad DaltonParticipantTh easiest way to do this would be to not add a name to the blog page template.
'
July 1, 2014 at 3:05 am #112346VejperMemberThen it the page under page management would just be blank and it wouldn't be clear what that page was for.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.