Skip to content

Commit 8c0759a

Browse files
committed
Adds category description parameter
1 parent f1f956d commit 8c0759a

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

include/lcp-catlist.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ public function get_category_link(){
184184
$cat_string .
185185
$this->get_category_count() . '</a>';
186186
}
187+
187188
array_push($link, $cat_string);
188189
}
189190
return implode(", ", $link);
@@ -213,6 +214,11 @@ public function get_category_count(){
213214
endif;
214215
}
215216

217+
public function get_category_description(){
218+
if ($this->utils->lcp_not_empty('category_description') && $this->params['category_description'] == 'yes'){
219+
return '<p>' . category_description( $this->lcp_category_id) . '</p>';
220+
}
221+
}
216222
public function get_conditional_title(){
217223
if($this->utils->lcp_not_empty('conditional_title') && $this->get_posts_count() > 0):
218224
return trim($this->params['conditional_title']);

include/lcp-catlistdisplayer.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ public static function get_templates($param = null){
105105
private function build_output($tag){
106106
$this->category_title();
107107

108+
$this->get_category_description();
109+
108110
$this->lcp_output .= '<' . $tag;
109111

110112
// Follow the numner of posts in an ordered list with pagination
@@ -328,6 +330,12 @@ private function category_title(){
328330
endif;
329331
}
330332

333+
public function get_category_description(){
334+
if(!empty($this->params['category_description']) && $this->params['category_description'] == 'yes'){
335+
$this->lcp_output .= $this->catlist->get_category_description();
336+
}
337+
}
338+
331339
/**
332340
* Auxiliary functions for templates
333341
*/

list-category-posts.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ static function catlist_func($atts, $content = null) {
112112
'terms' => '',
113113
'categorypage' => '',
114114
'category_count' => '',
115+
'category_description' => 'no',
115116
'morelink' => '',
116117
'morelink_class' => '',
117118
'morelink_tag' => '',

0 commit comments

Comments
 (0)