WordPress.org

Ready to get started?Download WordPress

Forums

Please please help! with post title position (5 posts)

  1. dksptwkd
    Member
    Posted 4 years ago #

    Please help me!
    My tanzaku theme shows headers(titles) top of images both in the contents page and also in the main index page
    and I really want to place titles 'below' images.
    My website is Roo-han.com
    Now I am just not putting titles but I don't think this is a solution.
    Could you please help me?
    Thank you.

  2. keesiemeijer
    moderator
    Posted 4 years ago #

    First we need to delete the title out of the template files on which you dont want the title to show on top of the post. (index.php, page,php, etc. etc.) Look for something simular to this <h2><?php the_title(); ?></h2> and delete these lines.

    Put this in your theme's functions.php:

    function my_post_title() {
    	Global $post;
    	return '<h2>' . $post->post_title . '</h2>';
    }
    add_shortcode('title', 'my_post_title');

    Now in your post you can use the shortcode: [title] On any place you want. And the post title will show up there.

  3. dksptwkd
    Member
    Posted 4 years ago #

    OMG! Thank you so much!
    This is exactly what I wanted!
    Again thank you so much! You saved me! *^0^*

  4. keesiemeijer
    moderator
    Posted 4 years ago #

    Glad it is working like you wanted! Now, please use the dropdown at top right to mark this topic 'Resolved'.

  5. dksptwkd
    Member
    Posted 4 years ago #

    Oh, yes, now I changed it to resolved. Thanks again! ^___^

Topic Closed

This topic has been closed to new replies.

About this Topic