Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Forum: Plugins
    In reply to: Order posts by category?

    Hi!
    I’ve tested the code and it works.
    It orderes posts by Category ,but it shows the posts ordered ASC (the newest post at last).
    if i change the DESC to ASC in “posts_orderby” it orderes only the categorys by CategoryID not the posts by Date.
    Can you say me how can i order the posts?

    Thanks ??

    Forum: Plugins
    In reply to: Group posts by Category
    Thread Starter nightwalker

    (@nightwalker)

    Thanks you! You’ve helped me a lot.
    But it seems to have some problems. Sometimes new posts doesn’t shown at the mainpage. I’m now reading the Taxonomy at the codex i hope i can solve it by my self ??

    Forum: Plugins
    In reply to: Group posts by Category
    Thread Starter nightwalker

    (@nightwalker)

    Oh you’ve done your second post some seconds before i’ve done my post.

    My problem is that there are also Categorys like Christmas, Eastern, Worldcup so that there are few posts in a limited period like only december for Christmas. Those Category should not shown all the time, only if there are new posts in these Categorys.

    I hope you know what i mean ??

    Forum: Plugins
    In reply to: Group posts by Category
    Thread Starter nightwalker

    (@nightwalker)

    Thanks for your Answer!
    I’ve read a lot about the Templatetags and the loop.

    I want something like: https://uk.reuters.com/
    but i don’t want to show the posts in ALL Category. It should only show the last 20 Posts ordered by Category.

    For example I’ve 5 Categorys Cat1,Cat2,Cat3,Cat4,Cat5 and at the main page the last 7 Posts are shown.

    ****Cat3

    Post from 18.12.2008
    Post from 15.12.2008

    **** Cat6

    Post from 17.12.2008
    Post from 16.12.2008
    Post frim 15.12.2008

    **** Cat2
    Post from 15.12.2008
    Post from 14.12.2008

    The last posts in Cat1 and Cat4 are from 11.12.2008 so this both cats doesnt shown at the Mainpage.

    I’ve try it with this code:

    <?php query_posts("orderby=category&order=DESC"); ?>
    <?php while ( have_posts() ) : the_post() ?>
    <div class="post" id="post-<?php the_ID(); ?>">
    <?php //To check if the category is alreasy shows to show the Category Name and Logo
    $category = get_the_category();
    $which_category=$category[0]->cat_ID;
    if (!($which_category==$is_category_shown)) :
    <div class="home-cat"><p class="home-categorie">
    <?php the_category(' '); ?></p>
    </div>
    <?php else : echo("<br />"); ?>					?>
    <?php endif; ?>

    At the end of loop

    <?php // TO set a number that the category is already displayed							$is_category_shown=$category[0]->cat_ID;
    						?>

    My problem is, that WP doesnt sort the posts by Category with
    <?php query_posts("orderby=category&order=DESC"); ?>

    i don’t know why ??

    Forum: Plugins
    In reply to: Group posts by Category
    Thread Starter nightwalker

    (@nightwalker)

    Nobody knows?

Viewing 5 replies - 1 through 5 (of 5 total)