Hi, @grsgrk
Is possible you help me for resolve this?? I need the same problem! How you resolved?
Thanks
-
This reply was modified 4 years, 4 months ago by
somarcio.
Hey somarcio, if you read my last post here: https://wordpress.org/support/topic/post-specific-category-links/, you’ll see that I never got this plugin to work as I needed. Instead I had to use the default WP list and modify it.
I don’t remember all the details since it was almost 3 years ago but hopefully that gives you another idea. I guess the author didn’t have a chance to add this function or doesn’t find it adds value.
Good luck!
Hi @grsgrk,
I resolved my problem replace code into the include/lcp-catlist.php:
I replace this code:
// Loop on several categories:
foreach($ids as $lcp_id){
$cat_link = get_category_link($lcp_id);
$cat_title = get_cat_name($lcp_id);
// Use the category title or ‘catlink_string’ set by user:
if ($this->utils->lcp_not_empty(‘catlink_string’)){
$cat_string = $this->params[‘catlink_string’];
} else {
$cat_string = $cat_title;
}
global $post;
// Do we want the link or just the title?
if ($this->params[‘catlink’] == ‘yes’){
$cat_string = $post->ID.’‘ .
$cat_string .
$this->get_category_count() . ‘‘;
}
array_push($link, $cat_string);
}
For my code:
global $post;
$cats = get_the_category($post->ID);
if($this->params[‘catname’] == ‘yes’){
foreach ($cats as $cat) {
$link_cat = get_category_link($cat->term_id);
if($this->params[‘catlink’] == ‘yes’){
$cat_string = ““.$cat->name.”“;
}else{
$cat_string = $cat->name;
}
array_push($link, $cat_string);
}
}
Thanks
-
This reply was modified 4 years, 3 months ago by
Matthew.
-
This reply was modified 4 years, 3 months ago by
Matthew.
-
This reply was modified 4 years, 3 months ago by
Matthew.
-
This reply was modified 4 years, 3 months ago by
Matthew.