Title: dsh2016's Replies | WordPress.org

---

# dsh2016

  [  ](https://wordpress.org/support/users/dsh2016/)

 *   [Profile](https://wordpress.org/support/users/dsh2016/)
 *   [Topics Started](https://wordpress.org/support/users/dsh2016/topics/)
 *   [Replies Created](https://wordpress.org/support/users/dsh2016/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/dsh2016/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/dsh2016/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/dsh2016/engagements/)
 *   [Favorites](https://wordpress.org/support/users/dsh2016/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[JustWrite] How to create a category post widget?](https://wordpress.org/support/topic/how-to-create-a-category-post-widget/)
 *  Thread Starter [dsh2016](https://wordpress.org/support/users/dsh2016/)
 * (@dsh2016)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/how-to-create-a-category-post-widget/#post-6436547)
 * Ok I figured out I had to edit the php file in C-Panel..
 * ..and put ‘cat’ =>3 below the line mentioned above. 3 being the number of the
   category name as far as I can tell.
 * class AC_Recent_Posts_Widget extends WP_Widget {
 *  function AC_Recent_Posts_Widget() {
    // Settings $widget_ops = array( ‘classname’
   => ‘ac_recent_posts_widget’, ‘description’ => ‘Displays your most recent articles.
   With or without thumbnails’ );
 *  // Create the widget
    $this->WP_Widget( ‘ac_recent_posts_widget’, __(‘ACOSMIN:
   Recent Posts’, ‘acosmin’), $widget_ops ); }
 *  function widget( $args, $instance ) {
    extract( $args );
 *  // Widget Settings
    $title = apply_filters(‘widget_title’, $instance[‘title’]);
   $recent_posts_number = $instance[‘recent_posts_number’]; $hide_recent_thumbs 
   = isset( $instance[‘hide_recent_thumbs’] ) ? $instance[‘hide_recent_thumbs’] :
   false;
 *  echo $before_widget;
 *  // Widget Front End Output
    if ( $title ) { echo $before_title . $title . $after_title;}
 *  $args = array(
    ‘posts_per_page’ => $recent_posts_number, ‘cat’ => 3, ‘ignore_sticky_posts’
   => 1
 * But after loading the widget and saving, all i get is a sentence under the recent
   posts widget that says “No popular posts available!”
 * Any ideas?
 * thanks

Viewing 1 replies (of 1 total)