Adding category to List Category Posts using template
-
Hi there
I am using the List Category Posts plug in and have configured my own template as follows:
<?php $lcp_display_output = ''; $lcp_display_output .= '<ul class="lcpgear_catlist">'; foreach ($this->catlist->get_categories_posts() as $single): $lcp_display_output .= '<li class="lcp_li">'; $lcp_display_output .= $this->get_thumbnail($single, 'class', 'lcpgear_thumb'); $lcp_display_output .= ' ' . $this->get_date($single, 'class', 'lcpgear_date'); $lcp_display_output .= ''; $lcp_display_output .= $this->get_post_title($single, 'class', 'lcpgear_title'); $lcp_display_output .= $this->get_comments($single); $lcp_display_output .= $this->get_excerpt($single, 'p', 'lcpgear_excerpt'); $lcp_display_output .= $this->get_content($single, 'p', 'lcpgear_content'); $lcp_display_output .= '<a>ID).'">Read more</a>'; $lcp_display_output .= ''; endforeach; $lcp_display_output .= ''; $this->lcp_output = $lcp_display_output;
[Please post code or markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
All is fine but I want to add the category itself with a link to other posts in the category in the normal way.
Although I can see that you add catlink=yes into the short code, I cannot get anything to work by adding a corresponding line of coding to the template. I assumed that this would do it:
$lcp_display_output .= $this->get_category$single);
but it just breaks the page.Can anyone tell me the correct line of coding to add to the template to get the category/link to appear?
many thanks
Kevin
- The topic ‘Adding category to List Category Posts using template’ is closed to new replies.