• Greetings,

    We’re currently making our own WordPress Theme and its been too long ago to remember how the loop worked for the category page. We currently have this buggy category.php:

    <?php
    
    get_header();
    
    if (have_posts()) : the_post(); update_post_caches($posts);
    
    echo '<div class="fullwidth">'."\n";
    echo '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>'."\n";
    echo '<td><h3>Posts in '. single_cat_title("", false) .'</h3></td>'."\n";
    echo '</tr></table></div>'."\n";
    echo '<div class="fullwidth">'."\n";
    echo '<table border="0" cellpadding="3" cellspacing="0" width="100%"><tr>'."\n";
    echo '<td class="normal"><b style="color: black">Title</b></td>'."\n";
    echo '<td class="normal"><b style="color: black">By</b></td>'."\n";
    echo '<td class="normal"><b style="color: black">Date</b></td>'."\n";
    echo '</tr><tr>'."\n";
    
    echo '<td class=normal>'. single_post_title('prefix', display) .'</td>'."\n";
    echo '<td class=normal nowrap>'. the_author_link() .'</td>'."\n";
    echo '<td class=normal nowrap>'. the_date() .''. the_time() .'</td>'."\n";
    
    echo '</tr></table></div>'."\n";
    
    else :
      _e('Sorry, no posts matched your criteria.');
    endif;
    
    get_footer();
    
    ?>

    But, it doesn’t display anything except this:

    Now we know we’re its missing a loop. Any little example will be appreciated since we can’t find anything about it in the documentary.

    Kind regards,
    Twimia Media

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘category.php’ is closed to new replies.