WordPress.org

Ready to get started?Download WordPress

Forums

Exclude posts on homepage under certain word/character count (1 post)

  1. jennrush75
    Member
    Posted 3 years ago #

    I'm working on redoing a radio website that includes newsfeeds. I'm using Rss Poster to pull the news articles into posts and then display links to some of them on the homepage. Sometimes RSS poster does not pull the full article and just has in the content:
    ABC News Radio … … Article source: http://abcnewsradioonline.com/world-news/cia-director-panetta-arrives-in-pakistan.html
    Is there a way I can exclude these from the posts I'm pulling using either under a certain word count or character count? Below's the code I use to pull the first posts in each category. The current site I'm working on is http://www.wimsradio.com/wimsam1420/:

    [please use the 'code' button to mark any code posted directly; for codes longer than 10 lines, please use the pastebin]

    <?php $args=array(
          'category_name' => national_news,
          'showposts' => 1,
          'caller_get_posts'=>1
        );
        $my_query = new WP_Query($args);
        if( $my_query->have_posts() ) {
          while ($my_query->have_posts()) : $my_query->the_post(); ?>
            <div class="newsheader">
    National News</div>
    <ul id="topnews">
    
    <li><h3><a>"><?php the_title(); ?></a></h3>
    <p><?php getImage('1'); ?><?php the_excerpt(); ?>
    </p></li>
    <p>
           <?php endwhile; } //if ($my_query)
      wp_reset_query();  // Restore global post data stomped by the_post().
    ?>

    Thanks so much!
    Jenn

Topic Closed

This topic has been closed to new replies.

About this Topic