<h3>[category title]</h3>
<li>[post title] - [comments] [date] [author]</li>
STYLESHEETPATH.'/list-category-posts/'.$atts['template'].'.php',WP_PLUGIN_DIR.'/list-category-posts/templates/'.$atts['template'].'.php',function sc_postimage($atts, $content = null) {
extract(shortcode_atts(array(
"size" => 'thumbnail',
"float" => 'none'
), $atts));
$images =& get_children( 'post_type=attachment&post_mime_type=image&post_parent=' . get_the_id() );
foreach( $images as $imageID => $imagePost )
$fullimage = wp_get_attachment_image($imageID, $size, false);
$imagedata = wp_get_attachment_image_src($imageID, $size, false);
$width = ($imagedata[1]+2);
$height = ($imagedata[2]+2);
return '<div class="postimage" style="width: '.$width.'px; height: '.$height.'px; float: '.$float.';">'.$fullimage.'</div>';
}
add_shortcode("postimage", "sc_postimage");I can't see the post thumbnail in the list page.
[catlist id=fossombrone thumbnails=yes excerpt=yes date=yes author=yes numberposts=-1]
This is my shortcode inside the page (where the id "fossombrone" is a town). In the default.php Post Thumbnail section there is "$lcp_display_output .= $this->get_thumbnail($single);" so I think the code is right but the thumbnail doesn't appear. I'm using WP 3.1.
Any idea? Thanks a lot, the plugin is so nice and useful.
Anyone having issues with templates, pay close attention to Fernando's first post. Mira:
Fernando said:Templates for the List Category Plugin are searched for in your WordPress theme's folder. You should create a folder named list-category-posts under wp-content/themes/your-theme-folder.
The two places where the plugin looks for templates (the current theme's stylesheet and template paths) is defined on line 32 of include/CatListDisplayer.php of the most recent version (as of this writing). I too was fooled by this, and unfortunately the basic documentation for the plugin does not make mention of this fact. That the plugin .zip file unpacks with its own templates folder would lead you to believe that the templates go there, but they don't.
If you want to prove to yourself the path for the template, modify CatListDisplayer.php (on a non-production site) starting at line 36 to look something like the following:
foreach ($possibleTemplates as $key => $file) {
echo "<h1>Checking: $file</h1>";
if ( is_readable($file) ) {
$tplFileName = $file;
echo '<h2 style="color:green">'. $file . ' okay!</h2>';
}
}
In my case, I created a template file called styledate.php in /my/sites/root/dir/wp-content/mythemename/list-category-posts, and everything worked as expected.
I agree with Fernando that the template should go in your theme folder, probably your child theme folder if you're being diligent about keeping your local customizations separate from the "factory default" themes and plugins. It makes sense once you know that's where the plugin is looking for the templates.
Fernando, do you think at some point in the future, por favor, you could clarify this on the documentation page, and in the readme.txt that comes with the plugin? I'll admit that readme.txt does give you some clues (like a link to this page), but it could be less confusing, especially around the **Usage** section.
Godoploid: you put that "shortcode" directly in the post editor for a WordPress post or page wherever you want the category list to show up. The reason it's not doing anything for you right now is probably because you made the same mistake I did and put your template in the wrong place, which you can correct by following the advice above.
cookieandkate said:Hi, your plugin is fantastic. I used it to create a list of categories and their corresponding posts at http://cookieandkate.com/recipe-index/. However, I think I'd rather display my standard size thumbnails (135 x 135) instead of the post titles. I'd like the images to appear side by side in rows. I figured out how to turn on the thumbnails (changed no to yes), but the thumbnail images were displaying at full size, not 135 x 135. I couldn't for the life of me figure out how to specify the 135 x 135 images. I tried creating a custom template and editing the php files, but no luck. Any suggestions? I'd much appreciate your help!
HQSecure said:Project404 - No!
I'm hacking away and had h2 tag success by adding to includes/CatListDisplayer.php around line 134:
private function get_post_title($single, $tag = null, $css_class = null){
return '<h2><a href="' . get_permalink($single->ID).'">' . $single->post_title . '</a></h2>';
}
It looks like you're new here. If you want to get involved, click one of these buttons!