WordPress.org

Forums

[Plugin : Language Switcher] apply_filters() (2 posts)

  1. nlex
    Member
    Posted 6 years ago #

    Hello. I use the plugin Language Switcher on my site. I have a little problem because i want to exclude one category in my post (i mean not to display one category that are listed at the end of each post). The exclusion works but i end with someting that don't work with the plugin. I need to filter the category name to display them correctly. The plugin page explained how to do sort of but i'm not a good coder. My code :

    <?php foreach((get_the_category()) as $category) {
             if ($category->cat_ID <> '15') { echo apply_filters(’the_category’, $category->cat_name . ' '); }}

    i tried this but it doesn't work :

    <?php foreach((get_the_category()) as $category) {
             if ($category->cat_ID <> '15') { echo apply_filters(’the_category’, $category->cat_name . ' '); }}

    any help ?

  2. nlex
    Member
    Posted 6 years ago #

    it works now with this code
    idon't even see the difference !

    <?php foreach((get_the_category()) as $category) {
             if ($category->cat_ID <> '15') { echo apply_filters('the_category', $category->cat_name) . ' '; }}

Topic Closed

This topic has been closed to new replies.

About this Topic