Adding 1 line of text under a post title
-
Hi I’ve used +10 hours of trying to figure this thing out (and also making the site smartphone friendly) and I finally decided to ask for help because I was screwing myself up by not eating food until much later than usually.
I’ve tried all kinds of CSS & PHP codes, adding them to my child themes, functions.php and style.css
Question:
How do I add a line of text under a title of a post, before the content?I tried to add a custom field for it, so I wrote this in a new custom field:
Name: after-title
Value: what I want the content to be under the title
and I added this to my functions.php:
add_action(‘loop_start’,’text_after_title’)
function text_after_title() {
global $post;
echo get_post_meta( $post->ID, ‘after-title’, true);
}but what it does is making the text appear above the title ??
- The topic ‘Adding 1 line of text under a post title’ is closed to new replies.