Background: I'm working on a customers site that I haven't build myself. The site works pretty ok, when I got it the wp_header and wp_footer was missing and the javascript files were all linked to before the body tag was closed.

WordPress 3.5.2

Issue: There is this problem with old posts and printing the updated content. The content is printed in a foreach where the attached images of one posts should be displayed. For some reason the old content is stuck there. I can update the post, see the content of the post, but I cant see the new content on the specific place where I'm trying to display it.

The foreach results in a scrolling div that is moving back and forward with the images.

I've tried: Repairing the database, to disable all of the plugins, update WordPress and all the plugins.

I don't have: Access to edit the database.

I would really appreciate some help with this if possible. Been searching for a solution almost a whole day now.


$bottomSliderImages = get_posts(
         'numberposts' => -1,
         'post_parent' => 54,     
         'post_status' => 'inherit',
         'post_type' => 'attachment',
         'post_mime_type' => 'image',
         'order' => 'ASC',
         'orderby' => 'menu_order ID'

<?php foreach($bottomSliderImages as $img): ?>
<?php $thumb = wp_get_attachment_image_src($img->ID, '200,94'); 
      if ($img->post_excerpt): ?>
      <a target="_blank" href="<?php echo $img->post_excerpt; ?>"><?php endif; ?>
      <img src="<?php echo $thumb[0]; ?>" alt="<?php echo $img->post_title; ?>" />
<?php if ($img->post_excerpt): ?></a><?php endif; ?>
<?php endforeach; ?>

1 Answer 1


So $img->post_excerpt is your content. It is the attachment's caption field. You must change the images' captions attached to the post with the id 54 in order to see any changes , if I understood the question right.

ADD: Also attach the images to the post.

  • Hi! Thank you for trying to help. I've tried to change the image caption but I still can't see the updated content. There's still the old one. I don't have any cache plugin so I don't understand how it can still be there.
    – Bellisia
    Jul 26, 2013 at 8:46
  • Hi , I would need to make some debugging. If you feel that you can trust me your WP credentials , i will help you with this. Don't write them here as it is not safe. Jul 26, 2013 at 9:02
  • Since it's not my site I can't give away any info about it. You don't have any other ideas without looking at it?
    – Bellisia
    Jul 26, 2013 at 9:20
  • At least a link to the page/post so i can see what is it about. The function looks fine. Jul 26, 2013 at 10:32
  • I've tried to remove things from the code, like the alt text and it works. But the images remains the same. And I cant figure out where they come from and why the images I've put in the post doesn't show. It's like the images are stuck on the site.
    – Bellisia
    Jul 26, 2013 at 10:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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