Unless you have added the functionality with a plugin or custom code, Pages are not placed in Categories. Pages are organized with Parent Pages and Children Pages. This is why (I suspect) in_category() does not work in page.php
The following code in functions.php will add categories to Pages.
/**
* Add categories to Pages.
* from http://shibashake.com/wordpress-theme/add-tags-and-categories-to-your-wordpress-page
*/
function add_custom_tags_box() {
add_meta_box( 'categorydiv', __('Categories'), 'post_categories_meta_box',
'page', 'side', 'low');
register_taxonomy_for_object_type('category', 'page');
}
Hope this helps.
Related Posts:
- How to have a static category/author page?
- Create single.php for specific category by category id
- custom query for both category and pages using global $wpdb;
- Custom Portfolio Page
- How can I make a category function as a page?
- Need help to structure our a complex hierarchy
- Getting page/category content to show up in my custom page template
- Gutenberg editor add a custom category as wrapper for custom blocks
- Decreasing the Memory Consumption of a WordPress Site?
- Multiple Domain Names – One WP Install (non-Multisite) – Default Each Domain name to Category Archive
- How can I select a primary category?
- how to use a different domain/subdomain for authors/catagories on single site?
- Deleting default category in wordpress
- How to get a list of term names of the custom post type im currently on in single.php
- Create a full width responsive header image per page
- Remove child products from woocommerce category page [closed]
- One WordPress Install, Two Categories. Each Category Gets a Domain
- I use same slug name for category and page
- Save metabox checkboxes values to custom content type
- Remove “Parent” Selection When Adding/Editing Categories?
- Show posts of category in a page
- Order Taxonomy Term by date created
- Show pages and articles in category search result
- How to create taxonomy values for pages and list them in wp-admin
- Viewing category pages without the word ‘category’ in URL
- Show only one category
- How to view WordPress’ default category IDs?
- Multiple Category Search
- Category-slug.php not being used
- How would I go about adding custom header images per category?
- Hard coded main navigation
- Display posts separated by Category in Author’s page
- previous/next_post_link in the same sub-category?
- Multiple URL’s based on category for one post
- category permalinks
- Filtering *out* a taxonomy from the admin post list
- Custom category URL rewriting
- Woo Framework: woo_cat_featured not populating
- Redirect to another page using contact form 7? [closed]
- Is it possible to remove from default category widget?
- How to customize my category pages
- How do I display something on a particular category page?
- I’m trying to create an array with a foreach loop, but the array only stores the last item [closed]
- How to create a subcategory to a PAGE on WP?
- Get the ID of 10 Latest Pages stored in a WordPress Category
- How to show 5 posts from specific category on related page?
- Problems with my conditionals in single.php by category
- How to put page numbers with the next/previous on a post/category list?
- How can I display tags as categories?
- How Do I Find & Remove H1 From Site-Title-Wrapper? [closed]
- .php file for woocommerce edit category? [closed]
- “Virtual category page” based on a custom field filter
- Creating php pages in wordpress and assigning them to wordpress pages
- Group search results by category
- Simple way to style posts of a single category differently in the loop and in single
- How can i change what one category displays?
- Two Sections on Woocommerce Catergory Page [closed]
- Getting the Most Recent Posts from Multiple Categories
- Showing Categories for Page Edit – without plugin
- How to let the user create a selection of categories via the backend
- Using categories with pages
- Exclude category from foreach loop
- Displaying One Custom Post Type’s Content On Single Post of Another Custom Post Type
- Custom css per category and per single post belong in each category
- How can I check which archive has referred the single? [closed]
- How to hide widget from certain category
- How to add icon over specific thumb
- Problem with Custom Post Type Categories
- SQL query to get posts from multiple categories but not in a category
- wp_delete_term or wp_delete_category?
- Displaying links to all posts of the same category on the post page
- Explode() expects a string
- How to add meta description, keywords, custom title to a category template
- separate posts to have (kind of) 2 blogs?
- display specific category when website loads
- I need to display posts in subcategory beside posts in main category
- Precheck fields when I add a new post
- Template category.php with page (no posts)
- Multiple if statements with else for get_the_category [closed]
- How to add Pagination to foreach loop to page
- Category For Pages In WordPress
- Inserting categories as a hierarchical terms from frontend form
- How to add a post with new Taxonomy without assigning to default category?
- Code to display category-specific single.php is overriding normal single.php, too
- Using wp_list_pages to create 2 lists of pages and include and exclude some of them depending on their category
- foreach,having wp_query inside, breaks after showing one result
- Display Referring Category on single post?
- Pages with posts filtered by category
- Own Custom Tags/Category page ( posts)
- How to create default categories in new installs?
- Pages, Categories, and working with someone else’s code
- Display only the latest post
- Page redirecting to category (IE only)
- Paginating a list of all posts collected by category titles
- Display static pages instead of category, in code
- not empty categories don’t show in menu [closed]
- Call Current Category
- Page permalink rewrite
- Post thats in Two Categories, only want to display name for one
- How can I show page per category in wordpress? (Yes, category by page!)