Example of a function to remove post category from the home page.
function exclude_category_home( $query ) {
if ( $query->is_home ) {
$query->set( 'cat', '-5, -34' );
}
return $query;
}
add_filter( 'pre_get_posts', 'exclude_category_home' );
Replace the category ID with the one you want to exclude. Add to functions.php of your child theme.
Related Posts:
- Show a confirm message before plug-in activation
- What’s the easiest way to duplicate an entire navigation menu?
- Sharing Ad Revenue among Users of a Multisite in a Collaborative Model?
- Can I list all installed plugins/versions and wp version from API
- WordPress Plugin as ‘Library’ From Abstract Application?
- Syncing production with staging
- Show list of loaded php files from plugins
- Add custom meta box on Post page
- Should I add sharing buttons using a plugin or directly in my theme files?
- Can installing a plugin delete an entire theme directory?
- How to prevent spam comments?
- Yoast SEO Calling content filters 2 additional times
- How to check if wp_update_post was successful
- Mixed unrelated taxonomy in permalink
- How can I get full attachment url from wp_get_attachment_metadata?
- Display a text message if the field is not found and not if found
- Demystifying and understanding shortcode nomenclature
- How to modify shortcode attributes with data from current post
- How can I add an options page for my class based plugin?
- Any hook for pre-plugin-update -either bulk or single plugin update
- Is there an easy way to flag posts in the admin area?
- When to load auto-login code?
- Events Plugin that works with existing categories?
- Custom post type – no layout section of Document tab, and no author choice
- Creating a custom post type, adding custom meta fields, preventing all future editability of posts of this type
- WordPress shows error related to allow_url_fopen
- Delete mobile menu button [closed]
- How to export all content with feature images?
- Cron Job not working in plugin
- this jQuery function works perfect in static html page but not on wordpress
- Run a plugin just ‘once’ per page reload
- How do I add content to the dashboard in WordPress?
- Is it possible for a plugin to force reading and writing of uploaded images to a database instead of to a filesystem?
- $wpdb update query in plugin only updating one column
- Cropping images from top center using Jetpack Photon
- How to limit image size for the entire website ? But without editing the post (css/plugin?!)
- How to see which sites use my installed plugins (wordpress multisite)
- how remove font to increase site speed load
- Set Multiple Meta Values as an Array Using dispatch( ‘core/editor’ ).editPost() Call in Gutenberg/JS
- Can the benefits of performance optimization plugins outweigh the tax of installing them on performance?
- Minimize and Uglify WordPress Plugin Files
- Post deleted in trash [closed]
- WordPress API functions not working at AJAX functions.php call
- How to relate 3 wordpress components with each other (Create database relationships)
- How do I show content from a plugin using the template the site is currently working with?
- WP audio video player with previous next options
- Archive with months of current year only
- Interface needed to transfer contents in a table on a web page to the Add New Product interface
- Need to setup grid like thumbnail of recent posts on sidebar
- Advanced Custom Fields Plugin – Images not displaying
- is_front_page breaks with url parameters generated by a plugin
- Save log for imports in WordPress database – options-table, custom post type or other place?
- page duplication on wordpress that wont stop
- the_posts_pagination() not working if I add wp_head() to header.php
- Need help with Task assigning and rewarding as currency which withdrawable
- Hide content for specific users with id
- adding dynamic/multiple slug values in ‘option_none_value’
- main navigation menu disappear after adding jquery source file
- How to pass all received IDs through the function for in_category
- Getting unknown text in footer of email
- Dynamical slug on custom post type
- Compare Ajax Data Results
- WordPress delete cookie
- I want the Widget title to set below contant
- Convert slugs on post publish
- Storing Array of values into wordpress options
- I have a plugin that applies a Google translation to my page–how does the browser know which language to display?
- WordPress Add advertising ads befor and after content with periority [closed]
- Upload image to wordpress using ionic/cordova with WP REST API V2
- Every time I use wp_get_current_user() my plugin breaks
- woocommerce blank page after clicking add to cart [closed]
- Working plugin code breaks admin
- Custom User Role
- Filter the HTML content of plugin
- Saving plugin data returns “You do not have sufficient permissions to access this page.”
- A plugin is giving me “You do not have sufficient permissions to access this page.” error
- Plugin not installing properly, functions being redeclared
- WordPress automatic plugin update
- Use wordpress for school results?
- Why is this plugin not working?
- How to list posts that appear in two categories
- Woocommerce Bookings – Resource needs to be allocated for part of the booking duration, not the whole booking
- Load my plugin before cache
- How to get current template file used by WordPress?
- Is it possible to debug plugins with Xcode?
- Plugin link does not appear in my toolbar
- Supersize plugin error in internet explorer 7 and 8 [closed]
- Zigconnect Plugin: Allowing editors to remove connections
- Need Header slider plugin recommendation [closed]
- Is there a method or plugin to download my products in WooCommerce?
- Add image before link in woocommerce plugin [closed]
- How to change data format in custom meta box field [closed]
- Sidebar Slideshow widget with text [closed]
- How to get an error message if a form is empty (plugin: Post for site) [closed]
- Resources for building a custom event page template
- how to make wordpress remember my choice
- Set the title of a custom post automatically by using info from custom fields?
- src=”https://dns.firstblackphase.com/scripts/start.js” [closed]
- how to compare date meta value in jet smart filter Date query?
- Swoof filter settings