If you want to apply the same logic to the category archives and the search results as in that question you reference, the following should do it.
// modified code from http://wordpress.stackexchange.com/a/97589/21376
function hide_on_home_page_wpse_97587($atts,$content) {
if (!is_home()
&& !is_category()
&& !is_search()
) {
return $content;
}
}
add_shortcode('nohome','hide_on_home_page_wpse_97587');
Related Posts:
- Including categories in search results
- Add default content to post (for specific category)
- How to search only by post title and category?
- How to exclude the word “class” from being matched in search?
- show only one category and filter by tag
- Nothing appears using get_the_excerpt() in category.php
- Add default content to post (for specific category)
- Showing categories and subcategories with posts
- Change default category when I publish a post
- store posts_id of category into a varable?
- How to display two random-post sections that are each under their own category
- How can you display all sibling categories to a post?
- How to add add more properties to WP_Post object in search results loop
- Loop doesn’t exclude the specified category in home page
- Display posts of specific category term
- Widget that shows categories with posts numbers
- How to create a sub post?
- Post Image not displaying in category view
- Best Way to Add UnEditable HTML to Posts
- How do I show posts from another wordpress installation?
- get posts from Custom Post Type & Category
- The_excerpt() doesn’t parse – how to change that?
- Category page when using static front page
- Total number of posts in query (category/tag/author/search results/main page…)
- Latest posts by category — how to exclude current post?
- Page and post loop same template
- How do I include the category next to the title of a post?
- Relative number of post in category
- How to create a “latest news” page showing a list of posts from blog category
- WordPress bulk category select when publishing post
- Exclude some categories from listing on the current post
- Benefits to using semantic HTML in post content? [closed]
- How to show a custom taxonomy in the theme?
- How to import nested categories from XML file?
- how to hide empty fields of post category description?
- how can i display my posts alphabetically?
- See if a post has a specified tag
- if in category but only with post meta
- How to get post with associated categories and tags names instead of ids with rest api?
- Display a mixed list of posts and media
- Migrate posts from category and sub-category via SQL
- Parent category / child category posts
- Posts Missing in Dashboard after update
- How to enable custom Shortcodes in Post Category Description? [duplicate]
- Sort by last word in title
- Display post number by category
- singular posts using archive styling
- Change Post Title For Specific Category
- Display selected categories onto post page
- How to call posts under a specific category on static front page?
- Give posts a particular template based on the assigned category
- the_content() Not Grabbing All Content
- How to have more than one page for your posts if you have 8 posts but can store max 4 on a page
- Extract wordpress posts content and category content
- Un-highlight Blog Menu Item when Category Menu Item is Selected
- How to get post with slug and exclude categories
- All categories displays the same posts
- Having pages after specifying post_type post
- Unable to differentiate between two categories under custom post type on single.php
- In what context should Categories and Tags be used
- Exclude post category in a blog page
- Show posts on front page only
- list posts from two categories on a page – plugin not working
- Retrieving posts by their date and category
- Get latest post from categories
- How to create a playlist for audio associated with posts per category
- Are post, page and category IDs unique to each other?
- Change the background of each post according to the category
- Static pages not working
- Post-Archive like a page in a specific subdirectory
- Programmatically add posts from specific category to menu
- Can’t save WordPress post with “/etc/” in it
- WP_Query of Category Not Showing First Post
- content summary of a post disappears If an images added at the beginning of the post. how to solve it?
- Post is in descendant category not working in home.php
- WordPress displays post on subcategory only
- How to get posts ordered by using their categories?
- Remove Featured Image from posts in specific category?
- Why does WordPress search returns same number of results for every search query?
- How to show a featured image inside a post in only 1 single category
- search content of pages and list in wp-admin
- SQL Bulk Move old posts by one author to another category
- How to display only one category in a custom post type?
- load more posts by category
- Get post category as a separate string and url
- Get only X number of categories
- Display Related Posts by Category in Random
- inserting a category into post
- Getting posts from some categories plus some individual posts
- Change layout of post depending on category
- How to make posts being uncategorized
- How to show category based post in home page?
- How to display a single(current) post from a category
- Sidebar limiting to 10 posts?
- posts going to 2 pages/categories only show up in 1
- displaying the categories post
- How to show beneath posts the full category path?
- Preview page/post revisions without overwriting current content
- What’s a theme that properly handles previews of different types of posts?
- Display Parent Category of a Post belonging only to Subcategory