Ready to get started?Download WordPress


A Simple Question (4 posts)

  1. mythusmage
    Posted 8 years ago #

    Below is an example of The Loop. I have my suspicions about it, But I'd like to be sure. What is wrong with this example of The Loop?

    The Example Loop

    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    <div class="post" id="post-<?php the_ID(); ?>">
    <h2>" rel="bookmark" title="<?php _e('Permanent Link to','andreas09'); ?> <?php the_title(); ?>"><?php the_title(); ?></h2>
    <p class="date"><?php _e('Posted by','andreas09'); ?> <?php if (get_the_author_url()) { ?>"><?php the_author(); ?><?php } else { the_author(); } ?> <?php _e('on','andreas09'); ?> <?php the_time (__('F jS, Y','andreas09')) ?>
    <div class="entry">
    <?php the_content(__('Read the rest of this entry »','andreas09')); ?>

    <?php trackback_rdf(); ?>
    <?php trackback_url(display); ?>
    <?php if(function_exists('wp_print')) { print_link(); } ?><br/>
    <?php if(function_exists('the_views')) { the_views(); } ?><br/>
    <?php if(function_exists('the_ratings')) { the_ratings(); } ?>
    Tags: <?php the_post_keytags(); ?>

    <p class="category"><?php _e('Posted in','andreas09'); ?> <?php the_category(', ') ?> | <?php edit_post_link(__('Edit','andreas09'), '', ' | '); ?> <?php comments_popup_link(__('No Comments »','andreas09'), __('1 Comment »','andreas09'), __('% Comments »','andreas09')); ?>

    <?php endwhile; ?>

    BTW, I did add a few things? :)

  2. moshu
    Posted 8 years ago #

    The wrong thing is... posting long code here without following the instructions below.

    Use a pastebin service, nobody will read it here.

  3. mythusmage
    Posted 8 years ago #

    Moshu, that was rude. My mistake does not excuse your behavior. There are better ways of handling matters like this. It is time you learned to handle matters with diplomacy.

  4. WildBil2Me
    Posted 8 years ago #


    part of your code got turned into links - it makes it a bit harder to diagnose on this end.

    Quick scan - you're missing the final 'endif;' to close the loop. You also appear to be missing a few </p> tags.

    What is the problem you're having? What are you interested in accomplishing with the loop?

Topic Closed

This topic has been closed to new replies.

About this Topic