WordPress.org

Ready to get started?Download WordPress

Forums

wp list-(titles and descriptions)- I just dunno (2 posts)

  1. ken102
    Member
    Posted 8 years ago #

    I have created a static homepage for the wp site(home.php) and am trying to list 2 sets of category posts on the page in different places on the page but am having difficulties.
    I have tried many combinations and loops but am getting errors when they are added together.

    I have spent hours on this (trial and error)and I now give up and hope someone can help.

    **in the first list of posts (not in the sidebar but in the content part for both)
    I wish to list the latest 20 posts from category 1 only.
    listed as:
    Title(linked)
    Description (read more...)
    Comments(0)

    **in the second list of posts, I wish to list the latest 20 posts from all categories EXCEPT category 1. listed in the same fashion as the first request.

    I have tried mainly using the loop thingy but come up baffled every time. There must be an easy way to call this in but I am truly baffled.

    any help with this would be great.

    PS: please do not direct me to a wp-tutorial page because I have seen them all but simply cannot figure it out.
    Posting the actual code would be marvelous.
    Thanks in advance.

  2. ken102
    Member
    Posted 8 years ago #

    Bump..

    Hi again, just to bring this issue to the front lines again.

    To give you an idea, I have tried to use (manipulate) the following code which displays all posts.

    <UL>
    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?> <!-- <span class="date"><?php the_time('F jS') ?></span> -->
    <LI> <H3 ID="post-<?php the_ID(); ?>"><A HREF="<?php the_permalink() ?>" REL="bookmark">
    <?php the_title() ?> </A></H3></LI><DIV CLASS="entrymeta"> <?php _e("Category:"); ?>
    <?php the_category(',') ?> </DIV><?php wp_link_pages(); ?> <?php the_content(__('(more...)')); ?>
    <DIV CLASS="edit"><SPAN CLASS="commentlink"> <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
    </SPAN></DIV><!--
    <?php trackback_rdf(); ?>
    --> <?php comments_template(); ?> <?php endforeach; else: ?> <?php _e('Sorry, no products matched your criteria.'); ?>
    <P> </P><?php endif; ?> <DIV CLASS="center"> <?php posts_nav_link('  ', __('« Previous'), __('Next »')); ?>
    </DIV>
    </UL>

    Unfortunately, this piece of code will display all posts and it would be great if someone can edit it to display only the posts in category 1. and again to display all posts except category 1.

    Any help would be appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic