Community Forums › Forums › Archived Forums › General Discussion › Blog template Page Title Not Showing
- This topic has 15 replies, 3 voices, and was last updated 10 years, 11 months ago by
Josephine.
-
AuthorPosts
-
October 20, 2014 at 11:59 pm #128569
meghanwagner
MemberI am attempting to put the title 'blog' on the blog page while using the blog-page.php template.
I have tried:
add_action( 'genesis_loop', 'genesis_standard_loop', 5 );but it doesn't work,
I've also tried a few functions along this line:
add_action( 'get_header', 'add_title_to_blog' );
function add_title_to_blog() {
if (is_page_template('blog-page.php') ) {
add_action( 'genesis_entry_header', 'genesis_do_post_title' );
}
}But nothing is working.
http://carecap.com/blog/
I feel like I am missing something...
Any help would be greatly appreciated.October 21, 2014 at 12:30 am #128573Genesis Developer
MemberTry this code. Add the code in page_blog.php file
add_action('genesis_loop', 'add_title_to_blog', 5); function add_title_to_blog(){ echo '<h1 class="entry-title"> ' . get_the_title() . '</h1>' . "\n"; }
October 21, 2014 at 9:03 am #128647meghanwagner
MemberNope doesn't work. Would it be possible to have something that is blocking the code or overriding it?
I'm just not sure what that would be.November 23, 2014 at 10:53 pm #132633Josephine
ParticipantHi, I see it works now on your website! Can you tell me how you achieved this? I woul really like to show the blog page title but still did not succeed...
Josephine
November 23, 2014 at 11:00 pm #132636meghanwagner
MemberHey Josephine,
This is how i got the title to show:
//Add Blog Title
add_action( 'get_header', 'add_blog_title');
function add_blog_title() {
if (is_home() ) {
add_filter( 'genesis_before_content_sidebar_wrap', 'blog_title' );
function blog_title() {
echo '<h1 class="entry-title">' . get_the_title() . '</h1>';
}}
}November 23, 2014 at 11:02 pm #132637Josephine
ParticipantWauw what a quick reply 😉 Did you place this in functions.php?
November 23, 2014 at 11:03 pm #132638meghanwagner
MemberYes in the functions.php file.
November 23, 2014 at 11:05 pm #132639Josephine
ParticipantI thought so but when I do that I get this:
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting ',' or ';' in C:\domains\vanstadtotwadwebdesign.nl\wwwroot\wp-content\themes\centric-pro\functions.php on line 212
November 23, 2014 at 11:06 pm #132640meghanwagner
MemberIt may not be the best solution but try removing ’ . get_the_title() . ‘ and just entering the title you want to show, it's not dynamic but that may be the problem.
November 23, 2014 at 11:10 pm #132641Josephine
ParticipantStil does not work here...
November 23, 2014 at 11:16 pm #132642meghanwagner
MemberHmm I'm not sure what to tell you. I'd double check that a semi-colon didn't get dropped.
November 23, 2014 at 11:22 pm #132643Josephine
ParticipantJust one question: did i have to adjust somthing in the page_blog.php also?
November 23, 2014 at 11:27 pm #132644meghanwagner
MemberNope you shouldn't. What is your site URL?
November 24, 2014 at 12:31 am #132646Josephine
ParticipantI can give you that but it would not be of any use, it is under construction.
November 24, 2014 at 12:37 am #132647meghanwagner
MemberNo problem, thought I could be able to help troubleshoot. Sorry I couldn't be any more help. Good luck!
November 24, 2014 at 1:00 am #132650Josephine
ParticipantThanks for your help so far!!
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.