Search
 
SCRIPT & CODE EXAMPLE
 

PHP

add categories to custom post type

All you need to do is add this line in the arguments for your custom post type.

'taxonomies'  => array( 'category' ),


It is likely that you may already have this line in the existing code for your custom post type with some other custom taxonomy in it. If you do, then you just need to add a comma after that and add a category, like this:

'taxonomies'          => array('topics', 'category' ),
Comment

PREVIOUS NEXT
Code Example
Php :: create a text file in laravel 
Php :: laravel seconds to hours minutes seconds 
Php :: cakephp 2.x join 
Php :: laravel session 
Php :: add to json object php 
Php :: replace multiple characters one string php 
Php :: storage in laravel 
Php :: laravel migrate refresh specific migration 
Php :: php select option 
Php :: laravel unsigned integer 
Php :: remove text keep numbers only php 
Php :: bigtext migration laravel 
Php :: create seed file laravel 
Php :: 2 decimal round using php 
Php :: Regex For Iranian Phone Numbers 
Php :: javascript inside php 
Php :: laravel auth user in constructor 
Php :: pluck array in laravel 
Php :: php datetime set timezone 
Php :: Fetch Data From Database With PDO 
Php :: laravel read file from tmp 
Php :: page break in dompdf 
Php :: how to get plugin directory path in wordpress 
Php :: range in php 
Php :: PHP Forms - Required Fields 
Php :: use id as key in co;lection laravel 
Php :: php array append 
Php :: php now 
Php :: php date function get previous month 
Php :: multiple logical condition in laravel query 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =