Forums

  • # December 27, 2008 at 7:30 pm

    i have it set up so that on my sidebar in wordpress it gathers and displays the posts that are in certain categories. however its not posting the right category. the to categories are news and cal. however its posting news in the calender section as well any ideas i have posted the script below. and heres the website url. http://apluscleaningfreeport.com
    the website is not complete as u can tell.

    any ideas?

    Quote:
    <div id="linksidbar">

    <div id="sidebarsearch">

    <?php include (TEMPLATEPATH . ‘/searchform.php’); ?>
    </div>

    <div id="news">

    <ul id="newsinside">

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

    </ul>
    </div>

    <div id="cal">

    <ul id="calinside">

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

    </ul>
    </div>

    </div>

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag