List category posts
conditional error based on category? (1 post)

  1. Randall Duley Jr
    Posted 2 years ago #

    Apologies first for what is likely a dumb question. I'm new to WordPress and PHP so I'm already over my head. It concerns this part of the code:

    if ( count( $this->catlist->lcp_categories_posts) == 0 )
        $lcp_display_output .= '<li>No results</li>';

    I just need a different error when there is no results but when in a particular category ('news'). I modifyied the error code but I'm getting identical results.

    if ( count( $this->catlist->lcp_categories_posts) == 0 )
        if ( in_category( 'news' )) {
            $lcp_display_output .= '<li>No news results</li>';
        } else {
            $lcp_display_output .= '<li>No results</li>';

    I'm trying to filter the error but it doesn't seem to evaluate the category at all. I always defaults to the last 'else' result.

    I could really use some help...sigh.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • List category posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic