HIde specific tags

This topic contains 5 replies, has 2 voices, and was last updated by  Paolo 8 years, 9 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #122926

    Joy
    Buyer
    Post count: 1076

    Hello, how can i hide specific tags from my listings? I tried with the following code with no success:

    
    
    $tags = get_tags();
    
     foreach ($tags as $tag)
     {
       if($tag->name=='the tag i want gone') continue;// do this for every tag you want gone
       echo $tag->name.', ';  
     }

    Thank you.

    #123194

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    GeoDirectory uses custom post types, thus custom taxonomies, not regular post tags.

    Please look into this : https://developer.wordpress.org/reference/functions/get_terms/

    You also have the exclude parameter to play with instead of using a conditional tag on the tag name.

    Thanks

    #123386

    Joy
    Buyer
    Post count: 1076

    Thanks Paolo for the link…but I have no idea what I’m doing. Can you give a little idea of how I should do this? Thank you.

    #123392

    Paolo
    Site Admin
    Post count: 31206

    If the link provided doesn’t give you an idea, it means that you need someone to write the code for you.

    That goes beyond support. I’m sorry.

    #123530

    Joy
    Buyer
    Post count: 1076

    Your plugin uses the standard WordPress taxonomies? I had a developer look at it and says that it isn’t so I wouldn’t be able to use the regular WordPress taxonomy function.

    #123743

    Paolo
    Site Admin
    Post count: 31206

    Yes it does, however your developer should know that tags is the default taxonomy for posts only. Custom post type use custom taxonomies.

    https://codex.wordpress.org/Taxonomies

    These are the terms name for GD taxonomies:

    gd_place -> gd_placecategory -> gd_place_tags
    gd_event -> gd_eventcategory -> gd_event_tags
    gd_hotel -> gd_hotelcategory -> gd_hotel_tags

    Thanks

Viewing 6 posts - 1 through 6 (of 6 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount