Support » Themes and Templates » Sort category list by date

Viewing 4 replies - 1 through 4 (of 4 total)
  • Ok I suppose not!

    Well I’ll post on here any solution I find…

    see ya
    ShadyCraig

    Well I managed to get something working.

    The concept is that the category with the newest post will be show first, with it’s 4/5 newest posts, aftter that the category with the next newest post will be shown with it’s newest posts … and etc

    See the results here: http://www.devineprojects.org/news/

    <?php
    $thiscat='';
    $newestcat[3];
    $i=0;
    $j=0;
    ?>
    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>

    <?php
    if (is_home()) {

    if ($i<3) {
    foreach((get_the_category()) as $cat) {
    }
    $thiscat=$cat;
    for ($j=0;$j<=$i;$j++){
    if ($thiscat->cat_ID!=$newestcat[i])
    {
    $newestcat[i] = $thiscat->cat_ID;
    echo "$thiscat->cat_name<br/>";
    c2c_get_recent_posts(
    4, "
    <li>%post_URL% @%post_date% (%comments_count%)<br>%post_excerpt_short%</br></li>
    ", $i, 'date', 'DESC', 0, 'd/m/Y'
    );
    $i++;
    $j++;
    }
    }
    }

    } else {
    ?>

    You might also want to see my Display by Category home.php template:

    http://wordpress.org/support/topic/38046

    Cheers Kafkaesquí,

    I’ll check that out!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Sort category list by date’ is closed to new replies.