• I am trying to access the code for the WordPress loop. I am using the twenty-ten theme. The code should look something like this, but I didn’t see it off hand in any of the files I looked through.

    [please use the ‘code’ button to mark any directly posted code]

    <ul class="posts">
    <?php query_posts('showposts=10'); ?>
    <?php while (have_posts()) : the_post(); ?>
    
    <li><a>" title="<?php the_title(); ?>"
    rel="bookmark"><?php the_title(); ?>
    </a></li>
    <?php endwhile ; ?>
    </u>
Viewing 1 replies (of 1 total)
  • You need to wrap any code here in `
    The wordpress loop code is in a<a href=”https://codex.www.ads-software.com/Function_Reference/get_template_part”&gt; template part</a> called loop.php.

    If you want to change the code and it is the index.php file, then save loop.php as loop-index.php make any change in this file.

    Better still use a child theme ??

    Line 56:
    <?php while ( have_posts() ) : the_post(); ?>

    In the upcoming twenty eleven theme the files are no longer called loop-index.php they are called content-index.php etc:

    HTH

    David

Viewing 1 replies (of 1 total)
  • The topic ‘accessing the loop code’ is closed to new replies.