• I’m using verison 1.3 of Clean Blogging, I added the Recent Posts widget to the Sidebar, and the following error is displayed:
    Notice: Undefined index: number_of_posts in /var/lib/wordpress/wp-content/themes/clean-blogging/inc/recent-posts.php on line 22

    I’ve got rid of the message by changing line 22 of recent-posts.php to:
    $number_of_posts = esc_attr(empty( $instance['number_of_posts'] ) ? 5 : $instance['number_of_posts'] );

    Has anyone else experienced this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author DesignGrande

    (@designgrande)

    Hi,

    I have been testing this widget but I never got any such error.

    Can you please tell me when you received this error?

    I mean did you added any custom number in the Number of posts to display: field?

    Thread Starter lukew151

    (@lukew151)

    Hi,

    Thanks for getting back to me.

    I believe this error appears, if you add the Recent Posts widget, and do not touch the form to set the Title and number. The leads to an instance of the widget without the properties set.

    In recent-posts.php:
    on line 18, you have code to check that $instance[‘widget_title’] is valid
    on line 22, you do not check that $instance[‘number_of_posts’] is valid

    This is how I believe I caused the error message.

    Thanks,

    Luke

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Recent Posts widget error’ is closed to new replies.