WordPress.org

Ready to get started?Download WordPress

Ideas

Flexible loop

  1. Kadmous
    Member

    I want to see an admin function where I can choose a layout for the loop. For example I choose a horisental loop, or a 2 columns loop, from left to right 2 posts and then 2 other posts from left to right and so on, random posts, and of coarse the usual loop.

    Posted: 7 years ago #
  2. Ajd777
    Member

    12345

    This would be done in the theme itself with an if else statement inside the loop.

    Anything related to displaying posts is done by the theme itself.

    To get you started to have the posts in two columns. (Of Course you need to apply widths to the tables and ensure you have an even number of posts displayed)

    Before the loop add:

    <table>

    Inside Loop add:
    `
    <?php

    if($x == 0){
    echo '<tr><td>';
    ?>
    Add Content of loop here
    <?php
    echo '</td>';
    $x =1;

    }else{

    echo '<td>';
    ?>

    Add Content of loop here
    <?php
    echo '</td></tr>';
    $x = 0;
    }

    ?>
    '
    After Loop add
    '
    </table>'

    Posted: 7 years ago #
  3. John Blackbourn
    Member

    12345

    Theme territory!!

    Posted: 7 years ago #
  4. Mark
    Member

    12345

    Typical theme functionality. No need to add theme logic to the core.

    Posted: 7 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

  • Rating

    12345
    105 Votes
  • Status

    This is plugin territory

Tags