Forums

Links to posts of a category (3 posts)

  1. eleis
    Member
    Posted 2 years ago #

    this is what i want the content part of page.php to look like:

    ------------
    TITLE
    PAGE CONTENT
    LINKS
    ------------

    I've got the title and page content down.
    The problem I am having is with the links.
    basically, if $post->ID == 91, i want links to every post in category 82 to appear under the content.

    I tried my way but it didn't work.

    Any suggestions?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

  3. eleis
    Member
    Posted 2 years ago #

    Thanks esmi!

    <ul>
     <?php
     global $post;
     $myposts = get_posts('numberposts=5&offset=1&category=1');
     foreach($myposts as $post) :
     ?>
        <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
     <?php endforeach; ?>
     </ul>

Topic Closed

This topic has been closed to new replies.

About this Topic