Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've been unable to move the post entry title to under the post's image. Whenever I do this, the title moves under the content and appears just above the footer.

loop-single.php -

<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<div class="post_title">
<div id="nav-above" class="navigation">
</div><!-- #nav-above -->

<div class="entry-meta">
</div><!-- .entry-meta -->
</div>

<table id="post-<?php the_ID(); ?>" <?php post_class(); ?>
<div class="entry-content-left">
<h3 class="entry-title"><?php the_title(); ?></h3>
<h2 class="the_subtitle"><?php the_subtitle(); ?></h2>

<div class="entry-content-right">
<?php the_content(); ?>

Here is my site. What am I doing wrong?

share|improve this question
    
Is the image added in the editor? Or as a featured image? –  gdaniel Jul 24 at 14:20

1 Answer 1

If you're adding the image directly in the editor, then the_content() will always echo the image. Which means the title can only be above the blog post or below it. You should try adding the image as a featured image. Take a look at this link to see how to add featured image support, and how to use it-> http://codex.wordpress.org/Post_Thumbnails

Basically you need to add the code below to the functions.php file. This will turn on the featured images option.

add_theme_support('post-thumbnails'); 

Update the loop to include the featured image.

<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<div class="post_title">
<div id="nav-above" class="navigation">
</div><!-- #nav-above -->

<div class="entry-meta">
</div><!-- .entry-meta -->
</div>

<table id="post-<?php the_ID(); ?>" <?php post_class(); ?>
<div class="entry-content-left">


<div class="entry-content-right">

<?php  
       //possible image sizes: thumbnail,medium,large,full

       the_post_thumbnail('full');

       <h3 class="entry-title"><?php the_title(); ?></h3>

       <h2 class="the_subtitle"><?php the_subtitle(); ?></h2>

      the_content(); 

  ?>

Go to your blog post edit page, look on the bottom right side for the "Set featured image" box. Add your image.

share|improve this answer
    
Only problem is my featured images are all portrait and some of the images I want to feature on my blog entry are landscape. Also for the most part I use wp galleries to display the images. Could I apply the same function as post thumbnail to the wp gallery? –  Social Monster Jul 24 at 16:46
    
I don't think that works with wp gallery because the gallery shortcode is also inside the content editor. If you want to show something before the title it needs to be outside the main content editor. The only other way I can think of doing that is with a plugin. You would need to add a custom image field. I, myself, use Advanced Custom Fields plugin for custom content, but there are other options. –  gdaniel Jul 24 at 16:54
    
Hmm... and there's no way to add the gallery to the loop without a plugin? –  Social Monster Jul 24 at 17:32
    
There is. do_shortcode() -> codex.wordpress.org/Function_Reference/do_shortcode But I don't think that will solve your problem. –  gdaniel Jul 24 at 17:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.