So, what you want to do just won’t happen without creating a new template and putting it into your theme. I created lcp-captionthumb.php, and, following the instructions in LCP’s default theme readme.txt, put it in a directory named “list-category-post” in the root of my theme.
Code is as-is/where-is… No warranty! ??
lcp-captionthumb.php:
<?php
/*
Plugin Name: List Category Posts - Template
Plugin URI: https://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/
Description: Template file for List Category Post Plugin for WordPress which is used by plugin by argument template=value.php
Version: 0.9
Author: Radek Uldrych & Fernando Briano
Author URI: https://picandocodigo.net https://radoviny.net
*/
/* This is the string which will gather all the information.*/
$lcp_display_output = '';
//Add 'starting' tag. Using Unordered list
$lcp_display_output .= '<ul class="lcp-catlist">';
/**
* Posts loop.
* The code here will be executed for every post in the category.
* As you can see, the different options are being called from functions on the
* $this variable which is a CatListDisplayer.
*
* The CatListDisplayer has a function for each field we want to show.
* So you'll see get_excerpt, get_thumbnail, etc.
* You can now pass an html tag as a parameter. This tag will sorround the info
* you want to display. You can also assign a specific CSS class to each field.
*/
foreach ($this->catlist->get_categories_posts() as $single){
//Start a List Item for each post:
$lcp_display_output .= "<li>";
//Start a div with class=lcp-thumb
$lcp_display_output .= "<div class=lcp-captionedthumb>";
//Post Thumbnail
$lcp_display_output .= $this->get_thumbnail($single);
//put in a <br/>
$lcp_display_output .= "<br>";
//Show the title and link to the post:
$lcp_display_output .= $this->get_post_title($single);
//close the div with class=lcp-caption
$lcp_display_output .= "</div>";
//Close li tag
$lcp_display_output .= '</li>';
}
// Close the ul tag
$lcp_display_output .= '</ul>';
//Return the data to the page
$this->lcp_output = $lcp_display_output;
?>
The CSS you’ll want to use to pretty it up:
.lcp-catlist li {
display: inline;
float: left;
margin: 5px;
padding: 5px;
}
.lcp-captionedthumb {
border: 1px solid rgb(153,175,93);
padding: 5px;
width: 125px;
height: 170px;
font-size: 70%;
text-align: center;
}
Called with the following shortcode:
[catlist id=2 thumbnail=yes template=lcp-captionthumb]
I handle displaying the headers…
You can see the output of all of this here:
https://roundwoodfurniture.com/andytest/