{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
  nogen steder med skudstopperen tilbage blonska63 0 20 06-18-2021, 01:45 PM
Last Post: blonska63
  starte sit seneste forsvar mod hviderussiske sracke189 0 30 06-16-2021, 02:59 PM
Last Post: sracke189
  bare ville dra til riktig chelseymc8 0 33 06-15-2021, 03:49 AM
Last Post: chelseymc8
  strada migliore da percorrere blonska63 0 37 06-14-2021, 06:52 AM
Last Post: blonska63
  Off White Clothing accsvipsales 0 31 06-13-2021, 07:19 AM
Last Post: accsvipsales

Forum Jump:


Users browsing this thread:
1 Guest(s)

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