Forums

Upgrade broke my theme - here is the code (3 posts)

  1. banago
    Member
    Posted 2 years ago #

    Upgrade to 2.8.2 broke the site. What shall I do.

    <?php
    	$size = 'large';
    	if ($images = get_children(array(
    	'post_type' => 'attachment',
    	'numberposts' => 1,
    	'post_status' => null,
    	'post_parent' => $post->ID,)))
    	foreach($images as $image) {
    	$attachment=wp_get_attachment_image_src($image->ID, $size);
    ?>
    <img src="<?php echo $attachment[0]; ?>" alt="" class="full"/>
    <?php } ?>
  2. Sheri Bigelow
    Member
    Posted 2 years ago #

    I tested that code block in a local 2.8.2 install and it worked. What lead you to that particular code block? Are you seeing any error messages? What exactly is broken? Do you have a link to the theme that people can download and test?

  3. banago
    Member
    Posted 2 years ago #

    Yeah, the code seems perfect, but my client had messed the site. I used another approach that worked, but that code works too. Thanks for confirming though.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.