Any ideas why this code suddenly stopped working?

I use a widget to display the latest “Haiku” category post in my sidebar and to show a specific related Haiku on single post pages. I suddenly noticed it no longer working on the home page today (but still working on the single post pages). Not sure if it’s because I updated to the latest WP today or if it had stopped sometime before. Anyone see any problems with this code?

<div id="haiku">
<?php if ( is_home () ) : ?>
<?php $recent = new WP_Query("cat=11&showposts=1"); while($recent->have_posts()) : $recent->the_post();
 ?>
<h6><?php the_title(); ?></h6>
<?php the_content(); ?>
<?php endwhile; ?>
<?php endif;?>

<?php if ( is_single () ) : ?>
<?php $haiku = get_post_meta( get_the_ID(), 'haiku', true ); ?>
<?php if( ! empty( $haiku ) ) : ?>
<?php $recent = new WP_Query("p=$haiku"); while($recent->have_posts()) : $recent->the_post();
 ?>
<h6><?php the_title(); ?></h6>
<?php the_content(); ?>
<?php endwhile; ?>
<?php endif;?>
<?php endif;?>
</div>
  • This topic was modified 1 week, 2 days ago by Nos402.



Source link