You don’t have to set that code in your functions.php.
Naming a file single-press.php should do the trick if you named well you custom post type when you declared it.
The post type should continue to use single.php.
I this doesn’t work, please provide wp version and custom post type declaration.
Related Posts:
- Get rid of WordPress category, tag and author archives?
- How do I get the category URL from get_the_category?
- How to add the category ID to admin page
- How to create a widgetized sidebar for every category dynamically?
- Only show category to certain user levels without plugin
- List Categories of the Parent Category of the Current Category
- Create single.php for specific category by category id
- exclude category from WordPress Form function
- wp_list_categories, Add class to all list items with children
- Remove “Parent” Selection When Adding/Editing Categories?
- How to get category id in single.php wordpress?
- Check is category parent or not from its ID
- How to show in search results posts with a particular tag in a particular category?
- How can I get an tag to wrap each ancestor that gets outputted in this condition?
- If category is in parent category?
- If in category to be inside of a function
- in_category() works in single.php but not in page.php?
- Rename Default Category (Uncategorized) Via a Function
- Check child/parent categories if exists
- Getting URL of archive (category) page
- How to show only one category in breadcrumb navigation
- Query posts from category based on a filter most favorited
- previous/next_post_link in the same sub-category?
- Send to different single pages by category when multiple categories exist
- How to make the link to the category for a post go to corresponding page number in archive?
- Add tag parameter to category.php
- Random Featured Image Based on Category
- Single.php Category Post Count
- add slug beside name in Admin Category Checklists
- Change div background acording to the selected category
- Problems with my conditionals in single.php by category
- Get next post in same category not working WP 4.7.4
- Simple way to style posts of a single category differently in the loop and in single
- How to use wp_list_categories with plugin category?
- How to get nav to show current_page_parent class when on regular post (not blog), differentiated by category
- How can I check which archive has referred the single? [closed]
- Redirect depending on category chosen
- How to add icon over specific thumb
- How to load several hierarchical categories from functions.php
- Change Default Content when Creating a Post based on Previous Category Choice
- How to add a custom thumbnail size for a specific category?
- Displaying links to all posts of the same category on the post page
- create function to call category name and slug
- Different size video display for category page (smaller) & detail page (larger)
- Ignore the Ad on Specific Categories
- custom wp_list_categories in single.php
- loop in single.php of the same category
- Display Some text in some specific category not all category
- When category name and title are the same … WP will select archive.php instead of single.php
- Using template file for single post in sub-directory multisite
- Loop Through Categories in Custom Field
- Display Referring Category on single post?
- Function to list posts from current post’s category fails in WP 3.8
- Modify / Rewrite single template url structure
- Show only one category in main query, issues on tag page
- How do I get a single page navigation depending on the previous page?
- Show parent-child relationship for categories in the wordpress admin
- How to create an automatic MultiColoumn MegaMenu with Categories WordPress
- Is There a Difference Between Taxonomies and Categories?
- List all subcategories from category
- How To Find Out WordPress Category Table in MYSQL?
- Add custom field to Category
- Get Category ID inside Category template
- Only one category per post
- WordPress Multisite – global categories
- Get the children of the parent category
- Get posts from sites in Multisite?
- WP REST API: filter by category 1 AND category 2
- How To Get Parent Category Slug of Current Post
- Display All Products by Category with WooCommerce
- What is the difference between a “tag” and a “category”?
- Is there an easy way to make a meta box have the tabs like the Categories meta box has?
- How to detect single.php (but not single-portfolio.php)?
- How to check if I’m on the last page of posts?
- Display posts from the same category using next/previous post link
- How would I get a taxonomy/category list inside a Gutenberg block?
- Can I set a default featured image for a category?
- Check if a post is in any child category of a parent category
- How to export and import taxonomies (category, tag and/or custom taxonomy) and their terms
- Force category choice before creating new post?
- Gutenberg editor add a custom category as wrapper for custom blocks
- WooCommerce: List All Categories
- How to get category and archive title?
- Get category ID from category slug (not working)
- How do I remove “Uncategorized” from posts with more than 1 category?
- Individual rss feed entry length for categories?
- How can I create a category landing page followed by pages of posts?
- Remove parent category from permalink? Basically only have the child category?
- Custom permalink structure leads to be 404 on pagination
- Retrieve Product category ‘NAME’ by product category ID – WooCommerce?
- Display random categories on the front page (Finding and Editing Theme Functions)
- Posts URL structure like site.com/category/the-post-title
- Can’t custom taxonomies have same terms (slugs) as categories?
- How to get permalinks with category base working with sub-categories
- How to remove the term “category” from category pagination?
- Using wp_category_checklist in a widget
- WP 3.9 TinyMCE no longer loads on category description editor
- On the category page, get the category object
- Get only the top level categories using get_categories() without foreach loop
- Get all categories and posts in those categories