Support » Fixing WordPress » WHy does this PHP ruin the loop?

  • So this code below is for the page template. My goal is to make it possible to use the featured image as a headline, if there is a featured image. Otherwise, I want it to simply output the title, as usually. However, when I try this code out, the result is an entire blank page, and the web debugger shows no code at all, so somehow this makes the server send the client/web browser a totally blank page.
    Any ideas?
    /Christoffer

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php if ( has_post_thumbnail()) {
    echo get_the_post_thumbnail( $post_id, $size, $attr ); }
    else {
    
    echo"<h1>the_title()</h1>";
    echo"<div class="hrThickFull"></div>";
    }
    ?>

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘WHy does this PHP ruin the loop?’ is closed to new replies.