• Hi – I noticed a bug in this widget – if you have multiple instances of this widget in a sidebar – specifically mixing one instances that displays posts, followed by another instances that display page(s), the pages won’t display because of this bug. Found that the “page” post type was being removed from the options, and the options were being read by following instances of the widget

    Fixed it with the following code in featured-page-widget.php:-

    ~ line 321

    /* Use this variable to store what page/post types we will show */
    $post_types = $this->options->post_types;

    /* Get the list of pages */
    if ( $instance[‘category’] != -1 ) {
    //unset the page post type from this variable
    $pages = array_flip($post_types);
    unset($pages[‘page’]);
    $post_types = array_flip($pages);
    $args = array(
    ‘category__in’ => $instance[‘category’],
    //’post__not_in’ => array($post->ID),
    ‘posts_per_page’ => $instance[‘items’],
    ‘orderby’ => ‘rand’,
    ‘post_type’ => $post_types,
    ‘ignore_sticky_posts’ => true,
    );
    } else {
    $args = array(
    ‘post__in’ => $instance[‘page’],
    ‘posts_per_page’ => $instance[‘items’],
    ‘orderby’ => ‘rand’,
    ‘post_type’ => $post_types,
    ‘ignore_sticky_posts’ => true,
    );
    }

    http://wordpress.org/extend/plugins/featured-page-widget/

Viewing 1 replies (of 1 total)
  • dgoats

    (@dgoats)

    Thanks for posting this. I was just starting to try to figure this out – but you figured it out for me!

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Featured Page Widget] Bug with multiple widgets, different page types’ is closed to new replies.