Put Title between content and image
-
Hello, I’m new in wordpress and I have simple question.
the_content() – this display whole post with first image, if image is added. How can I put title between first image and text?
I set something like this:
<?php if( has_post_thumbnail() ) : $content = get_the_content(); $content = preg_replace("/<img[^>]+\>/i", "", $content); $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); echo $content; else : the_content(); endif; ?>
So when there is thumbnail I set only text – and here there is no problem with title. But when thumbnail isn’t setted, I just can’t put title between first image from content and text.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Put Title between content and image’ is closed to new replies.