By default page post type doesn’t support category taxonomy. But you can easily fix it by register category taxonomy for page post type:
add_action( 'init', 'wpse8170_init' );
function wpse8170_init() {
register_taxonomy_for_object_type( 'category', 'page' );
}
Now you will see categories meta box in the same place as you see it at post creation page.
To get page’s categories just call wp_get_post_categories
function like this (thanks to @Subharanjan):
$page_categories = wp_get_post_categories( get_the_ID() );
Related Posts:
- How to check if I’m on the last page of posts?
- Loop with Dynamic Categories
- Remove child products from woocommerce category page [closed]
- Listing all posts from current category on page
- Getting the Most Recent Posts from Multiple Categories
- Include last post date in get_categories loop
- Page category filter in admin dashboard
- Template category.php with page (no posts)
- Adding a category view to a page
- Display Taxonomies in loop with template args
- Getting page/category content to show up in my custom page template
- Get the children of the parent category
- Should category.php and The Loop be used if the query needs to be customizable?
- How to Change the Categories Order in the Admin Dashboard?
- Exclude the category from the WordPress loop
- How do I get the category URL from get_the_category?
- Preventing index.php?category_name=something from redirecting
- Make all subcategories use the template of its category parent?
- get_field not displaying my custom field value
- Default WP Gallery – show only galleries of a certain category
- Rearranging posts based on categories
- WP_Query not looking at child category
- Randomise results from a category page?
- Get page content by category or tag
- Display all posts in category, with specific tag posts at top
- Show div only if post is in specific category
- Different templates for parent and children categories/taxonomies
- How to show a category post to a specific registered user
- posts page – different lengths of excerpt
- Display list of Sub-Categories and the posts they contain, within one main Category
- Category page showing posts from all categories
- Is including the loop necessary for page.php? [duplicate]
- How can I create a loop to build slides based on multiple categories using Coda Slider
- Display only deepest category on a single post?
- Create a full width responsive header image per page
- Get a list of commas separated categories inside a loop
- How do I set a specific template for sub-categories?
- Using same slug name for a page and category
- Categories list loop – add separator every year
- How would you create a “weekly” archive?
- Remove “Category Archives: title” at the top of a category page [duplicate]
- How to exclude categories from recent posts, recent comments & category widgets?
- Exclude a category from the filed under list only on some templates
- How to have a static category/author page?
- Create single.php for specific category by category id
- I use same slug name for category and page
- Page with the same name of a category
- Display one latest post from multiple categories
- How do I get the total number of categories in a list of search results?
- Check if post belongs to any category
- is_archive() content being shown instead of is_category()
- Show posts of category in a page
- Remove Categories and Tags from Admin Dashboard
- How do I display the posts from a custom post type on a category.php page?
- Show pages and articles in category search result
- How to group the loop posts in a particular by author?
- How to override Category rendering mechanism
- How to control template resolution if both Author and Category filter in place?
- How to create taxonomy values for pages and list them in wp-admin
- Which php file lists all the post of a category
- Display products for a category, sorted by post_excerpt
- What type of page should i use? static page or category page? and what’s the difference? [closed]
- Filtering by Category doesnt paginate correctly on the backend
- Apply custom category template to subcategories
- Exclude category from loop not working
- Listing Parent, Child and GrandChild Categories and then the PostTitles on Page Template !
- Duplicate Category and Page URL loads Category instead of the Page
- Category archive page – loop through posts of certain tag (with pagination) – pre_get_posts
- Add a specific category at a specific place to the menu that uses wp_list_pages
- If newest post of category is newest post in general, skip first post of category
- Custom page for WooCommerce’s /product-category/
- a-z list, categories and sub categories in loop
- Code to pull in a PHP file named after the category ID
- Viewing category pages without the word ‘category’ in URL
- in_category() works in single.php but not in page.php?
- Why would in_category only return one post in a specific category?
- Is it possible to select and edit the way the most recent post from a certain category is displayed on the page?
- Categories vs. Page Site Organization
- Exclude category from Tag Template
- Custom order categories in admin dashboard
- How to make a Thumbnails Mosaic
- wp alchemy multiple image uploader output images to template
- Are Category or Tag Archive Pages Possible?
- How do I automatically put categories and their descriptions on a WP Page?
- Possible to make a subdirectory that loops through a single category?
- Need Category RSS Feed that shows all posts
- Displaying multiple loops based off of category
- WooCommerce IF statements not working
- How to loop only categories without posts (+ show category featured image with acf) [closed]
- Additional featured post on first page
- editing fonts of category links from the_category() funtion
- Is it possible to restrict viewing of category PAGE to logged in users only?
- Set a them for all subset of category
- Show all posts for a specific category/author
- Redirect category to url with /category
- create a page which displays a list of categories title+ short description?
- How to display only posts assigned to a particular, isolated, subcategory
- Enter a variable in the ‘category_name’ parameter
- Second level subcategory
- how to define category loop last class in the third