WordPress.org

Ready to get started?Download WordPress

Forums

WP_query not working on homepage (1 post)

  1. Ryan Paul
    Member
    Posted 6 years ago #

    Can anyone tell me why the latest news and events aren't showing on the homepage, but DO show anywhere else...

    http://www.culturallandscapes.ca/

    I'm using two instances of the following code:

    <?php $my_query2 = new WP_Query('category_name=cat-name-here&showposts=1&orderby=asc');
      while ($my_query2->have_posts()) : $my_query2->the_post();
      $do_not_duplicate = $post->ID; ?>
        <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
    <?php echo substr(get_the_excerpt(), 0, 100); ?>...
    <hr />
    <p><a href="<?php echo get_category_link(1);?>">View All <?php echo get_cat_name(1); ?> &raquo;</a></p>
    
      <?php endwhile; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic