To be a bit more precise. Here’s what I did to change the date to be in front of the title using a custom template file:
step1: Copy the template file: “default.php” from the plugin directory and paste it in a new folder in your (child)theme directory called: “list-catergory-posts.”
step2: Rename the file to a proper name for your template. something like: “mylist.php”
step3: Edit this file like this:
Change the third line to your filename (not sure if this is needed?)
Plugin Name: List Category Posts - Template "mylist"
Change the foreach loop on line 55 to something like you want:
I wanted to have the date in front of the posttitle so i did this:
foreach ($this->catlist->get_categories_posts() as $single){
//Start a List Item for each post:
$lcp_display_output .= "<li>";
//Show date:
$lcp_display_output .= $this->get_date($single, 'span', 'lcp_date');
//Show the title and link to the post:
$lcp_display_output .= ' - ' . $this->get_post_title($single, 'a', 'lcp_post');
Here I’ve changed the “show date part” to be higher up, before the title
Also changed the html attribuut to be a “span” tag and added a class name “lcp-date” to the date. Also remove the extra space in front of the date.
Then for the title I added an extra dash ” – ” in between the date and the title and changed the html attribuut to be an “a-tag”. Also added a different class: “lcp_post” so I can target it with css later.
Then I added this shortcode to my page:
[catlist template=mylist name=nieuws numberposts=5 date=yes dateformat="d-m-Y"]
Cheers Richard