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:
- is_plugin_active function doesn’t exist
- Activate a plugin through PHPMyAdmin or FTP?
- How to call a plugin function from index.php
- __(): What if I have to pass in a variable?
- How Does WordPress Uninclude/Deactivate A Plugin?
- Woocommerce checkout page custom checkbox ticked
- Why allow overriding crucial pluggable functions wp_verify_nonce and wp_create_nonce?
- What is the proper filter to add html to a post / page title?
- How to pass multiple values in shortcode?
- Back End Interface Plugin
- How do you auto-activate plugins from child themes
- Force wordpress to request for FTP Info on theme/plugin install/update
- How can I add a custom meta value on file upload?
- Prevent Brute Force Attack
- Check if the front end user is log in or not
- Disable wordpress from including jQuery in the head section
- Woocommerce Shipping module available only for type of products [closed]
- Plugin jQuery version VS Theme jQuery version: search for best practice
- Extensible code
- Setting Custom Email From name and email address in wp_email()
- Show only preview of posts on the homepage?
- Randomize attachment IDs
- Set the active Navigation Menu from a plugin
- What is the best way to mimic a search query within a plugin
- Programatically download a plugin
- Disable plugin per user role
- WordPress Registration Email by Role
- Modify the file inside plugin dir – the right way
- CSS from textarea in options page to frontend what to do
- Creating plugin using simple_html_dom parser?
- custom changes removed after plugin update
- wp_set_auth_cookie causes 403 error in the wooCommerce checkout
- Overide plugin files from child theme (/inc/ ) folder
- wp_schedule_single_event not working: cron job is triggered but nothing gets executed
- wp.media javascript issue with on select
- Finding the URL to be used to check if plugin is installed with a theme
- Creating shortcodes in plugin
- Add ALT attribute to Pin It Button image to pass HTML5 validation
- Using arbitrary paths in page urls
- How to use my menu PHP code as sidebar?
- Change plugin name on WordPress repo
- Using wpdb without loading all plug-ins via wp-load.php
- Are plugins instantiated on every request to WordPress?
- Why shortcode always displayed after footer not in body
- adding a button to the media uploader
- Get path to themes CSS file inside of a Plugin
- how to activate a plugin inside a theme
- Add some fileds to the wp_posts table
- How do I add $_SESSION[”] to my wordpress page?
- There has been a critical error on your website – won’t fix no matter what
- Get orders of a specific customer woocommerce
- What am is missing? (API CORS)
- How to find out which plugin create captcha after login?
- All in One SEO Pack error message
- How to fix broken media library?
- Deactivated Visual Composer plugin, site crashed, what to do? [closed]
- JQuery needs to be defined in , but Gravity Forms is defining it in the
- Does Deactivating a Plugin Help Anything?
- Plugin hook not working on specific WordPress installation – how to troubleshoot?
- Add Stack Exchange Recent Questions to a wordpress sidebar?
- How to hide plugin options for editors via functions.php
- WordPress Stats Plugin: Display Post Views [closed]
- Installed WordPress.com Stats with api key and forgot key. How can I register w/ new key?
- Shopp Plugin Remove Quantity Dropdown [closed]
- jQuery slider widget similar to cnet.com
- Custom content plugin for front page in wordpress
- In Multisite Setups, how to update mass sections of sub-sites
- Using file_get_contents within admin but keep logged in
- need to find duplicated meta value in custom filed and view the posts that have the same value
- Woocommerce plugin – How to create two versions of the same plugin with slightly different implementation for different users
- Push Contact form 7 variable to front end after submission
- Add a parameter at the end of the url and prettify
- Is there any known plugins that would replace WordPress classes in editor with their Bootstrap 4 equivalent?
- Add spacebar in WP List Table Search
- Error after installing the WordPress plugin updates
- Plugin to manage form submissions on admin panel
- Configuring default woo commerce login with modal popup
- How to iterate on a list?
- Is there a plugin to merge several drafts into a new post?
- URL Case Sensitivity (Unbounce Landing Pages)
- The etiquette of forking a plugin and table tag
- echo plugin results on pages
- How can I remove this sidebar from my Search Results page?
- How to pass value to a plugins shortcode?
- Confusing problem with displaying message recipient metadata
- When in WordPress I try to run a php script directly I am redirected to the home page
- How do I replace the e-mail form to functional e-mail subscription? [closed]
- installed WordPress but can’t upgrade or add plugins due to webdav https?
- Display WP Start bar on front page only
- Plugin (smart archives reloaded) crashed site / no access on admin panel
- Can’t pull metadata for a term in my theme’s function.php
- Looking for a wordpress referral plugin that counts the referral after an action is performed [closed]
- I used a plugin that hides wp-admin, but it hid wp-admin for admin too – how to revert back?
- How to use Link Manager
- How to make my plugin insert text into a custom div?
- Submit posts in two different post types with the same form
- Static page with formatted post list
- Load css classes after using ajax calls
- Preset categories in wordpress by GET-paremters [duplicate]
- Getting error when accessing Customizer Page