WordPress.org

Forums

List category posts
[resolved] Widget not listing category pages (2 posts)

  1. victorwyee
    Member
    Posted 2 years ago #

    I'm using the "Map Categories to Pages" (MCP) [1] plugin to assign categories to pages. One of MCP's settings is to "Show the Pages on Category pages." When that option is checked, List Category Posts (LCP) will list all pages under their respective categories (and when MCP's "Show the Pages on Category pages" is not checked, LCP doesn't list the pages).

    My problem is that the LCP widget does not list categorized pages when viewing posts (e.g. a latest posts front page, or a single post). The LCP widget does list categorized posts as expected. The strange thing is that the LCP widget does list categorized pages when viewing a page!

    What can I do to get the LCP widget to list categorized pages?

    Thanks!

    [1] http://wordpress.org/plugins/map-categories-to-pages/

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

  2. victorwyee
    Member
    Posted 2 years ago #

    Oops, should've looked at the code more carefully earlier.

    To resolve my problem, I changed the post_type that LCP was requesting to 'any' (see code below). I didn't really do any debugging, so I'm not sure why LCP was behaving differently between posts and pages. My guess is that LCP determines the post_type from the current post/page you're viewing (since I didn't see any way to set post_type in the widget options).

    I currently have LCP version 0.30.3. In include/CatList.php, I changed lines 53-55 from

    if($this->lcp_not_empty('post_type')):
       $args['post_type'] = $this->params['post_type'];
    endif;

    to $args['post_type'] = 'any';

    Reference:
    http://wordpress.org/support/topic/plugin-map-categories-to-pages-how-to-put-pages-list-in-widget-sidebar

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