Timeline for How to customize category_description()?
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 12, 2015 at 11:43 | vote | accept | tali | ||
Sep 12, 2015 at 11:42 | comment | added | tali | yesssssssssssssss its working :))) wow what a relief!!! thank you so much cybmeta ,thank you so much pieter :)) now I will try to understand why you choose to use category_description($Ecategory->term_id) instead of this $Ecategory->description.thanks again | |
Sep 12, 2015 at 10:19 | comment | added | cybmeta |
In the code you have added to the question you are using $Ecategory->description , not category_description() function (you asked specifically about this function), so the category_description filter won't be applied. Note that you are printing the category description field directly from the database results. As @PieterGoosen said, you need to replace $Ecategory->description with category_description($Ecategory->term_id) or apply wp_trim_words() directly to $Ecategory->description .
|
|
Sep 12, 2015 at 8:31 | comment | added | tali | I have added some code above, but the trim works only on the first category (parent category) | |
Sep 12, 2015 at 6:27 | history | edited | cybmeta | CC BY-SA 3.0 |
added 150 characters in body
|
Sep 12, 2015 at 6:18 | history | answered | cybmeta | CC BY-SA 3.0 |