Support » Fixing WordPress » all my images have dissapeard and I didn't touch anything

  • I think my problem has something to with the wordpress 3.9 update or something.

    But whats happened is : daisymariesmith.com
    1 month ago site worked perfectly.
    Checked it the other day and only the images which where in posts are there?

    1. I have already manually instaled the new wordpress update. nothing changed.
    2. Deactivated and update all plugins. nothing changed
    3. the images are still in my media library.

    This is my code for my single.php file where the images are missing from.

    <?php get_header();?>
    </head>
    <body>
    <div id='postcontainer'>
    
    <div id='goback'>
    <a>">BACK TO PORTFOLIO</a>
    </div><!--/goback-->
    
    <div id='posttext'>
    <?php if(have_posts()):while(have_posts()):the_post();?>
    
    	<h2><?php the_title(); ?></h2>
    
    	<p><?php the_date(); ?></p>
    
    	<?php the_excerpt(); ?>
    <?php sharing_display(); ?>
    
    <?php endwhile; else: ?>
    Sorry, no posts
    <?php endif; ?>  
    
    </div><!--/posttext-->
    <div id='postimages'> 
    
    <?php if(have_posts()):while(have_posts()):the_post();?>
    	<p><?php the_content(' '); ?></p>
    <?php endwhile; else: ?>
    Sorry, no posts
    <?php endif; ?> 
    
    <?php
    
        $args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => $post->ID );
        $attachments = get_posts($args);
        if ($attachments) {
            foreach ( $attachments as $attachment ) {
                the_attachment_link( $attachment->ID , false );
            }
        }
        ?>
    
    </div><!--/postimages-->
    
    </div><!--/postcontainer-->
    <?php get_footer();?>
        </div><!--/wrapper-->
      </div><!--/container-->
    </body>
    </html>

    link to portfolio page where images show up fine http://daisymariesmith.com/portfolio/
    link to single post where it stuffs up http://daisymariesmith.com/mountains/

    Also when I inspect element in chrome my div <div id=’postimages’> doesnt exist?

    Please help

Viewing 1 replies (of 1 total)
  • There’s an error on your site when I try to access the link to your single.php. You may want to check your single.php template file on line 20, specifically on “sharing_display()” function where PHP reports that the function doesn’t exist.

    Fatal error: Call to undefined function sharing_display() in /home/daisymar/public_html/wp-content/themes/thirteen/single.php on line 20

    Also, if you have two post queries in a single template file, to be safe, end each query with <?php wp_reset_query(); ?>. In your case, paste the code after the endif; of the first query:

    <?php if(have_posts()):while(have_posts()):the_post();?>
    
    	<h2><?php the_title(); ?></h2>
    
    	<p><?php the_date(); ?></p>
    
    	<?php the_excerpt(); ?>
    <?php sharing_display(); ?>
    
    <?php endwhile; else: ?>
    Sorry, no posts
    <?php endif; ?>
    <!-- ########### PASTE CODE HERE ######### -->

    Good day!

Viewing 1 replies (of 1 total)
  • The topic ‘all my images have dissapeard and I didn't touch anything’ is closed to new replies.