Community Forums › Forums › Archived Forums › Design Tips and Tricks › How to get the post title in the new Genesis Themes
- This topic has 2 replies, 2 voices, and was last updated 12 years, 3 months ago by
pluzito.
-
AuthorPosts
-
February 21, 2014 at 5:07 pm #91807
pluzito
ParticipantHello everybody, thanks for your help, I'm back at the forums with this issue. Now I'm using the new version of Magazine Theme (at http://RobertoRamasso.com), but I can't get the old query <?php the_title(); ?> to work. What I need is to show a box to my visitors with something like this:
"Thank you for reading <?php the_title(); ?>. If you enjoy it, please share it!"
I could do this from the functions.php with a code like this:
add_action( 'genesis_entry_footer', 'my_custom_content', 6 );
function my_custom_content() {echo '<p>"Thank you for reading <?php the_title(); ?>. If you enjoy it, please share it!"</p>';
}
But what I couldn't get working is the function to display the post title. Is there any new hoook or function to replace this one <?php the_title(); ?> ?
Thanks in advance for your help, and have a nice weekend!
http://RobertoRamasso.comFebruary 22, 2014 at 3:01 am #91889Brad Dalton
ParticipantFebruary 24, 2014 at 3:54 pm #92201pluzito
ParticipantHi Brad, and thanks a lot for your help. I read the info in that link and I could show de Post Title, but not within the text I need to show. And the post title appears in H1 instead in <p> like I need it.
I have this function in my functions.php
add_action( ‘genesis_entry_footer’, ‘my_custom_content’, 6 );
function my_custom_content() {echo ‘<p>”Thank you for reading [HERE IS WHERE I NEED TO GET THE POST TITLE]. If you enjoy it, please share it!”</p>’;
}
In the Non Genesis retro Studiopress themes I get that working using this string: <?php the_title(); ?>
I tried putting this:add_action( ‘genesis_entry_footer’, ‘my_custom_content’, 6 );
function my_custom_content() {echo ‘<p>”Thank you for reading <?php the_title(); ?>. If you enjoy it, please share it!”</p>’;
}
But didn't work. Then I tried:
add_action( ‘genesis_entry_footer’, ‘my_custom_content’, 6 );
function my_custom_content() {echo ‘<p>”Thank you for reading add_action( 'genesis_entry_header', 'genesis_do_post_title' );. If you enjoy it, please share it!”</p>’;
}
Didn't work neither and gave a blank screen. So I tried:
add_action( ‘genesis_entry_footer’, ‘my_custom_content’, 6 );
function my_custom_content() {echo ‘<p>”Thank you for reading echo the_title();. If you enjoy it, please share it!”</p>’;
}
Which hook or code I need to add to my functions to get it working? I just need to get the post title with a call, it's everything I need. Please help me, I'm starting feeling like a dummy and frustrating 🙁
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.