• Resolved victorwyee

    (@victorwyee)


    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] https://www.ads-software.com/plugins/map-categories-to-pages/

    https://www.ads-software.com/plugins/list-category-posts/

Viewing 1 replies (of 1 total)
  • Thread Starter victorwyee

    (@victorwyee)

    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:
    https://www.ads-software.com/support/topic/plugin-map-categories-to-pages-how-to-put-pages-list-in-widget-sidebar

Viewing 1 replies (of 1 total)
  • The topic ‘Widget not listing category pages’ is closed to new replies.