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
- Preventing index.php?category_name=something from redirecting
- Make all subcategories use the template of its category parent?
- posts page – different lengths of excerpt
- How can I create a loop to build slides based on multiple categories using Coda Slider
- Display only deepest category on a single post?
- How do I set a specific template for sub-categories?
- Categories list loop – add separator every year
- How would you create a “weekly” archive?
- How to exclude categories from recent posts, recent comments & category widgets?
- is_archive() content being shown instead of is_category()
- Which php file lists all the post of a category
- 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
- Listing Parent, Child and GrandChild Categories and then the PostTitles on Page Template !
- Duplicate Category and Page URL loads Category instead of the Page
- Add a specific category at a specific place to the menu that uses wp_list_pages
- Categories vs. Page Site Organization
- Custom order categories in admin dashboard
- wp alchemy multiple image uploader output images to template
- Highlight wp_nav_menu when category is selected
- How to make 2 tag feeds show up on 1 page?
- Class active for Archive link – looped out
- Taxonomy name repeating when showing 2 posts from each category
- Different templates for different category tags
- Search in custom post type AND in pages with category
- Display the last post by each category?
- Give a page priority over a category that has the same name?
- Counter in loop in foreach
- How to exclude the last post from a category(featured for example) from the main loop?
- Different banner for different section
- Order by category titles
- ajax for filtering posts by category in wordpress loops
- Sub category templates
- Custom taxonomy template for categories
- How do I make a variable available inside partials?
- Limit get_categories to show each category once
- Display single category name in woocommerce loop
- Show Posts from Single Category Not Working
- Is there a reason I cannot get the current category in a loop?
- new WP_Query all post in a category inside the loop
- Problem with different query loops (and “main loop”) on category template page!
- How to add orderby parameter for sorting on category.php
- How do I get category and page ID’s?
- How to loop custom post_type from (a) specific category(ies)?
- Category tags with comma’s
- Display posts of certain categories to specific user roles
- Trying to create a Categorised Index (archive?) to use as my Home Page
- Using if statement in index.php instead of creating separate template files
- Template for product-category page [closed]
- Category nicename inside loop in wordpress
- filter a loop base on specific category
- Problem with multiple loops in wordpress theme
- Displaying year once in category.php [duplicate]
- custom query for both category and pages using global $wpdb;
- How to differentiate the homepage structure from the category page structure in WordPress template?
- How do i create a list-posts-page?
- Editing Loop So It Targets Specific Tags?
- posts going to 2 pages/categories only show up in 1
- Include home page template in specific category template
- Posts made to category don’t show up (do show up on frontpage)
- How to use category slug with a regular page
- Display all categories but only if they have posts in them that have a specific tag assigned
- How to prevent WordPress from redirecting single page to prefixed category archive with same name?
- How to distinguish pages created by woocommerce?
- Custom Archive Template for Multiple Categories
- Please tell how to stop the category from showing up on posts
- Loop by category and meta_key
- Category custom template is not showing correct posts
- Assign a class to first element in category in loop
- Configure query with multiple categories in a custom order?
- Show posts from all categories
- Paginations in Category Page Leads to Sample Pages
- How to exclude a specific categogy from a custom page template
- Most efficient way to have 1 template for parent, 1 template for child categories?
- Category Templates for Post Types not Working
- Fake Single WordPress Post (Page) Loop
- My Query is getting the wrong data
- Need help with category page customization meeting certain condition
- How do i add custom post types to this query?
- How do I get a single page navigation depending on the previous page?
- how to style an individual page in a category [duplicate]
- Custom WordPress category page showing all posts rather than the specified category
- Add 1 category more to If_in_category statement
- Redirecting posts in WordPress to a specific page
- Category Template – to be editable from the backend?
- Do not show all post from all categories, just show posts from category in current loop
- have_posts is empty on category.php
- Echo Category In Loop