WordPress.org

Ready to get started?Download WordPress

Forums

adding category description to "posts by category" plugin (1 post)

  1. jvolvovski
    Member
    Posted 6 years ago #

    Hi, I am using a plugin called Posts By Category.
    The plugin basically lists all the posts and the title of each category on a single page.

    I am trying to add the category description in there as well, but can't figure it out how for the life of me.

    Any ideas would be greatly appreciated.

    Here's the code that shows the category names and posts names.

    foreach ($last_posts as $posts) {
    	  $current_category = apply_filters('list_cats', $posts->name, $posts);
    	  $the_output .= '<tr><td><div class="menu_title">' . $current_category . '</div></td></tr>';
              $where = apply_filters('getarchives_where', "WHERE post_type = 'post' AND post_status = 'publish'" , $r );
              $arcresults = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' AND ID IN (Select object_id FROM {$tp}term_relationships, {$tp}terms WHERE {$tp}term_relationships.term_taxonomy_id =" . $posts->term_id . ") ORDER BY post_date DESC");
    	  foreach ( $arcresults as $arcresult ) {
    	       $the_output .= '<tr><td id="name_' . $arcresult->ID . '">' . apply_filters('the_title', $arcresult->post_title) . '</td></tr>';
    	   }
              $the_output .= '';
           }
           $the_output .= '';
           return $the_output;
    }

    Thanks very much,
    Jenny

Topic Closed

This topic has been closed to new replies.

About this Topic