WordPress.org

Ready to get started?Download WordPress

Forums

multiple loops more categories (2 posts)

  1. gighen
    Member
    Posted 7 years ago #

    hi... i have tow loops working... but into the small one i need 2 or more categories.. right now the code is

    <?php
    $my_query = new WP_Query('category_name=Sport&showposts=10');

    if( $my_query->have_posts() ) : ?>

  2. <h2>Altri articoli</h2>
    <ul class="bor">

    <?

    while ($my_query->have_posts()) : $my_query->the_post();

    ?>

    <li id=”post-<?php the_ID(); ?>“>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>“><?php the_title(); ?> <?php the_excerpt_reloaded(0, '', 'none', TRUE, '>>>', FALSE, 2); ?>

  3. <?php endwhile; ?>

    <?php endif; ?>

    i need to add another category to the query but i'm getting only errors

    $my_query = new WP_Query('category_name=Sport AND ANOTHER CATEGORY HERE&showposts=10');

    how i can fo that?

  • gighen
    Member
    Posted 7 years ago #

    nothing?

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags