Customizable Post Listings
-
I am using the Customizable Post Listings plug-in on WP v2.3.3:
https://www.ads-software.com/extend/plugins/customizable-post-listings/When I try to specify a category, no content shows up. I have used this plug-in in the past before upgrading from 2.2.x to 2.3.3 and it worked fine.
Has anyone found a solution for this?
-
same problem… no posts appear. I’ve read the rather lengthy topic about categories/terms but I haven’t a clue where to start trying to fix this.
Anyone in touch with scott reilly? I really love both cpl and his custom fields plugin…
anyone have a good replacement for
c2c_get_recent_posts ($num_posts = 8, $format = '<li style="padding:.5em;">%post_date%: %post_URL%</li>', $categories = '94', $orderby = 'date', $order = 'DESC', $offset = 0, $date_format = 'm/d/Y', $authors = '', $include_passworded_posts = false);
I’m open to ideas and new plugins…
thanks
I’ve got some mod code from comment #82 here https://lorelle.wordpress.com/2007/02/14/customizable-post-listings-wordpress-plugin
I’m not able to get the
c2c_get_recently_commented(10, "<li>%post_URL%</li>", "", "", "", "", '8'); ?>
to display the single author’s comments. I’ve tried all sorts of variations 8, “8”, ‘8’, $curauthor->ID and none seem to work.c2c_get_recently_commented(10, "<li>%post_URL%</li>");
gets the last 10 comments from everyone.I was so stoked to find this plugin. It should do exactly what I need, but is not working. Any love out there?
what exactly do you want to achieve?
Thabks clarkburbidge, #82 resolved my problem.
I’m using this plugin for two lists.
1. As described in the post above, I’d like a list of the 10 most recent comments by a registered user, in this case user 8, but I will be making that take the user ID from whatever author is being viewed in the author template.
2. In another instance list all the comments in a long list.
Neither seem to work, but at the lorelle link above in the comments I was told that this plug in is in the process of being updated. I think that the queries are a bit off in the plugin as offered in the link I mention.
I just decided to skip the whole plugin thing and use my own code for showing two different sets of content on the same page, limiting the number of posts for the second and displaying in a preferred order…
the first loop:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php if ( in_category('4') && is_home() ) continue; ?>
<!–tags and arguments for how to format the content here for the homepage Page post–>
<?php endwhile; ?>
<?php else : ?>
<?php endif; ?><?php
//now query to get recent posts from a category (news)query_posts(‘cat=94’);
$posts = get_posts(‘category=94&numberposts=8&offset=0&order=DESC’);foreach ($posts as $post) : start_wp(); ?>
<!–tags and arguments for displaying these links to posts–>
<?php endforeach; ?>
Actually, it's a tiny bit more than that, but I left out the html for each type of content... that is it, though... you can run the loop several times using this method, just include another line with the appropriate category number for each coming after the first loop, and use the second method block of code to query, start, & end the loop <?php if ( in_category('x') && is_home() ) continue; ?>
—————
I love plugins… it’s definitely one of the coolest features in WordPress. But it is infinitely annoying to become dependent on a particular plugin that becomes obsolete when the author doesn’t maintain it through WordPress evolutions. (not whining, though ??
I am happy to hear that this plugin might get some attention… it’s a good one.
clarkburbidge: I’m not sure I totally get what you are after, but I’m a bit stretched for time to think it through properly. *but* I was wondering why don’t you use e.g. phpMyAdmin to experiment (Google is a great reference source) and build your own MySQL SELECT query that gives you what you want, especially if you want to use the lists outside of the Loop – its really not that hard. Then either build it into your template or make it your own plugin – you may succeed before the plugin is ready and if not you can always fall back on the plugin(s)
I used your post as inspiration to give it the old college try. I found this:
https://codex.www.ads-software.com/Function_Reference/wpdb_Class#Examples_5
and was able to get a list of 5 recent posts. But I really want 5 recent comments by an author. I have been unable to adapt the code to get comments.
$authid is the user ID of the author.
This worked for posts:
<?php $fivePosts = $wpdb->get_results("SELECT ID, post_title, guid FROM $wpdb->posts WHERE post_status = 'publish' AND post_author = $authid ORDER BY $wpdb->posts.post_date DESC LIMIT 5"); ?> <?php echo ('<h4>Recent Posts</h4>'); ?> <ul><?php foreach ($fivePosts as $fivePost) { ?> <li><a href="<?php echo $fivePost->guid; ?>"><?php echo $fivePost->post_title; ?></a></li> <?php } ?></ul>
This did not for comments:
<?php $fiveComments = $wpdb->get_results("SELECT comment_content FROM $wpdb->comments WHERE comment_approved = 1 AND user_id = $authid ORDER BY $wpdb->comments.comment_date DESC LIMIT 5"); ?> <?php echo ('<h4>Recent Comments</h4>'); ?> <ul><?php foreach ($fiveComments as $fiveComment) { ?> <li><?php echo $fiveComment->comment_content; ?></li> <?php } ?></ul>
Any help to get the comments one going?
comment_approved = ‘1’ ??
very quick off of the top of my head, if you look at the wp_comments table I think you’ll see that it doesn’t have a user_id column. You’ll probably have to search by the name and/or email address etc. associated with the comment (more sophisticated integration of the registered users and their comments is I think possible, but uhm, would be more sophisticated ?? you probably want to end up with something that generates a MYSQL query that looks a little bit like
SELECT * FROM wp_comments WHERE comment_author LIKE '%admin%' OR comment_author_email LIKE '%andre@pixel%' LIMIT 0 , 5
h.t.h.
This code lists all the comments made on your site with the author linked to the author page and the posts title linked to the post with the full comment content.
<?php $fiveComments = $wpdb->get_results("SELECT wp_comments.comment_author, wp_comments.user_id, wp_comments.comment_content, wp_users.user_login, wp_posts.post_title, wp_posts.guid FROM $wpdb->comments LEFT JOIN $wpdb->posts ON wp_comments.comment_post_ID = wp_posts.ID LEFT JOIN $wpdb->users ON wp_comments.user_id = wp_users.ID ORDER BY $wpdb->comments.comment_date DESC"); ?> <ul><?php foreach ($fiveComments as $fiveComment) { ?> <li><a href="https://www.[yourblog].com/author/<?php echo $fiveComment->user_login; ?>/"><?php echo $fiveComment->comment_author; ?></a> on <a href="<?php echo $fiveComment->guid; ?>"><?php echo $fiveComment->post_title; ?></a> said - "<?php echo $fiveComment->comment_content; ?>"</li> <?php } ?></ul>
This lists the last 5 comments made by an author on an author page as described here or by this plugin.
<?php echo ('<h4>Recent Comments</h4>'); ?> <?php $fiveComments = $wpdb->get_results(" SELECT wp_comments.comment_content, wp_posts.post_title, wp_posts.guid FROM $wpdb->comments LEFT JOIN $wpdb->posts ON wp_comments.comment_post_ID = wp_posts.ID WHERE user_id = $authid ORDER BY $wpdb->comments.comment_date DESC LIMIT 5 "); ?> <ul> <?php foreach ($fiveComments as $fiveComment) { ?> <li> "<?php echo $fiveComment->comment_content; ?>" - <a href="<?php echo $fiveComment->guid; ?>"><?php echo $fiveComment->post_title; ?></a> </li> <?php } ?></ul>
Try this, make sure you change the ‘cat=0’ to the proper cat #
<?php query_posts('cat=7&showposts=5'); ?> <?php while (have_posts()) : the_post(); ?> <li> <a href="<?php the_permalink() ?>"> <?php the_title() ?> </a> </li> <?php endwhile; ?>
- The topic ‘Customizable Post Listings’ is closed to new replies.