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.

In pages-news.php

<div class="thirteen columns"><?php 
if ( has_post_thumbnail() ) {
  the_post_thumbnail();}  ?>
  <div class="title-blog">
    <h2><a href="<?php the_permalink() ?>"> <?php the_title(); ?> </a></h2>
</div><?php 
if( in_array( $post->ID, array() )) {
  echo get_the_content();
} else {
  echo get_excerpt();
}?>
</div>  

In single-page-news.php

<div class="thirteen columns">
  <div class="title-single"><h2><?php the_title(); ?></h2> </div>
  <?php the_content();?>
</div>  

The pages-news.php is what I want but the single-page-news.php is wrong. For the single page of article, at first I want the_post_thumbnail, after that the title of article, and then the content. How can I do that?

share|improve this question
2  
Move code from former to latter?.. –  Rarst May 18 '13 at 20:01
    
The result is the same. <?php the_content();?> has the_post_thumbnail. –  MikeD May 18 '13 at 20:07
    
what theme is that? the_content() does normally not show the featured image. –  Michael May 18 '13 at 20:13
add comment

1 Answer 1

This seems too simple. I am afraid that I have badly misunderstood something. Apologies if that is the case.

Alter single-page-news.php to be...

<div class="thirteen columns"><?php
  the_post_thumbnail(); ?>
  <div class="title-single">
    <h2><?php the_title(); ?></h2>
  </div><?php
  the_content(); ?>
</div>  
share|improve this answer
    
I do that. For this i have : post_thumbnail->title -> post_thubnail-> text –  MikeD May 18 '13 at 20:10
    
The the_post_thumbnail only shows up once in that code. Do you have a filter on the_content that might be duplicating it? Comment out the the_content() line and see what happens. –  s_ha_dum May 18 '13 at 20:13
    
No i don't have any filter. When i comment out the the_content() show only the title and post_thubnails –  MikeD May 18 '13 at 20:25
1  
Here you seem to say that the_content does not print the post thumbnail but above you say that the_content prints the post thumbnail, which is not normal and means you probably do have a filter. It is very, very, very hard to work out what you mean. Do you mean thumbnails with at 's'-- more than one? –  s_ha_dum May 18 '13 at 21:44
1  
I thought it was something like that. –  s_ha_dum May 18 '13 at 21:46
show 1 more comment

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.