{myadvertisements[zone_1]}
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How To How To Hide A Specific Category From Showing Inside Post In WordPress
#1


Hello guy Today am going to be teaching you how to hide a specific category from showing up in post section.


Many having been asking

I have a category about the catalog, news1 Which I use to get a post on the main page. The problem is that I don't want the news1 category name to appear in these posts, but I want other categories to be displayed.

How can I do this?

Login to your wordpress site 
Click on Appearance 
Editor 
Function.php

Past the below code in your function.php


add_filter( 'get_the_categories', function ( $categories, $id ) {
foreach ( $categories as $i => $term ) {
if ( 253 == $term->term_id ) {
unset
( $categories[$i] );
}
}
return $categories;
}, 10, 2 );




Change the { if ( 253  (253) to your category id you wish to hide 

How to find category id in wordpress 

Click On Posts > Categories >
Find the one you want to hide, and click on the category on the url box scroll to the id and copy the id 
Or 
Press and hold the text you will see the category id 

To Purchase Credit Click here , For how to make money on Sologet forum Click here 

HIRE ME FOR WEBSITE DESIGNING USE THE PM BUTTON TO SEND ME MESSAGE

There is love in sharing
{myadvertisements[zone_3]}
  


Messages In This Thread
How To Hide A Specific Category From Showing Inside Post In WordPress - by Kingsolomon - 10-23-2019, 07:43 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Celine Bags allonsalevips 0 68 03-15-2021, 06:19 PM
Last Post: allonsalevips
  HELP My WordPress blog play audio instead of downloading it if i hit download link Frank 1 553 02-07-2021, 03:58 PM
Last Post: Thomehx
  What is an Opt in Dubai email list arifa1 0 291 12-07-2020, 05:55 AM
Last Post: arifa1
  MUST READ List of Best WordPress Themes Zenmarc 1 1,087 07-11-2020, 05:22 PM
Last Post: Adejoh101
  HOW TO How to Fix the 502 Bad Gateway Error in WordPress khodex 2 1,634 05-05-2020, 03:25 PM
Last Post: niki12345

Forum Jump:


Users browsing this thread:
1 Guest(s)

{myadvertisements[zone_2]}
How To Hide A Specific Category From Showing Inside Post In WordPress00