WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Randall Duley Jr
    Member
    Posted 1 year 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.

    http://wordpress.org/extend/plugins/list-category-posts/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic