You can just change the if (is_category()){
line:
// Remove category archives
add_action('template_redirect', 'jltwp_adminify_remove_archives_category');
function jltwp_adminify_remove_archives_category()
{
// Ignore category 20.
if (is_category() && !is_category(20)){
$target = get_option('siteurl');
$status="301";
wp_redirect($target, 301);
die();
}
}
Related Posts:
- Display random categories on the front page (Finding and Editing Theme Functions)
- How to add classes to images based on their categories?
- current_cat_ancestor Alternatives
- Add body class of category parent
- Changing a function in function.php to a shortcode – for listing categories of only a certain post type
- Php string not working in WordPress Functions.php (trying to fetch 1st category for each blog that post appears in the sidebar)
- Add class to Categories Widget
- How to Acheive the custom woocommerce category template
- How to add a rel attribute to images that contains their categories?
- How to set child post categories to parent post categories when updating parent post?
- Assign category using custom field?
- How To Get WordPress Categories Link List?
- Changing post category from dropdown
- Manipulate Output of wp_list_something: select menu instead of li’s
- Make Categories a Dropdown Menu in Media Library
- Programmatically Create Category and sub Category
- Attach parent category template to all subcategories
- exclude a category from a search on a specific page
- Get the category name outside of the loop in category.php
- Is it possible to change any of the HTML/URL returned from the_category()
- Custom HTML in specific category single page and its descendant categories
- Possible to display shortcode based on the category?
- Unset Category if other Category is unset during post transition
- Select pages by category
- Show Primary Category first when I display post categories
- How do I hide or remove ‘Category’ from wordpress breadcrumbs
- Ordering posts by publish date not working?
- Categories as main menu items and subcategories as nested lists
- Get category URL for current post
- Need help “sanitizing” a custom function that pulls category slug into body class
- allow only one post in specific category
- How to obtain the recent posts without their content in an efficient way?
- Setting a default text for excerpts of a particular category
- Running script based on Category
- Remove a category from a post when saving a new post
- How to fix get_the_category function returning incorrect slug?
- Return category name with & Ampersand doesnt work
- Access category within rss2_head hook?
- issue with if/elseif in_array inside foreach loop display only one post
- Randomizing wp_tag_cloud() in child theme
- add_filter to specific WooCommerce Category
- How to rewrite wordpress search to work on specific category
- Image loading function not working on archive.php template
- Exclude Category ID in function
- Problem with calling custom function in a foreach loop
- Specify multiple categories for custom post template – FATAL ERROR
- “All posts” in the category widget
- Get Attachment Category Name
- WordPress Categories: Function using custom SQL to return array of specific category IDs
- Display ACF category image on archive and single template files
- Get slug of current category in functions.php
- Display a list of random terms from custom taxonomy with shortcode
- Change category display name function
- Display link to category over featured image
- Remove the ‘category’ url for one category type
- Custom Function.PHP Code Not Working on One Site
- Adding new Category does not refresh the backoffice
- How do i tweak my wp Post title base on category of the post
- how to remove a tag in the_category function
- Menu and category highlighting for a single post
- i can’t use wordpress functions in ajax loaded php file
- Graphic before title – Specific Category
- require_once() Causing categories and tag pages on dashboard to not refrsh
- different body classes for each category
- How To Get WordPress Categories Last Update Date?
- How to get tags and categories?
- How to Insert A List of Posts in A Category Written by the Author into the Author Archive
- Get category of post inside save_post hook
- wp_mail not running inside Cron
- Remove product description from product archive page
- Increment price for Woocommerce Minicart [closed]
- Change woocommerce products weight varation based its product category or tags? [closed]
- Completely disable RSS feeds on WP 5.5.2 and show a 404 page instead of die();
- Check if row exists before inserting
- Removing the main link to Jetpack from the menu
- Defining a global array in functions.php?
- Set quantity of woocommerce product on page visit [closed]
- get_post_type() in in_array doesn’t work for some reason
- How to remove set_post_thumbnail_size() in child themes?
- How to load jQuery in the footer – nothing works for me
- how to en-queue jQuery to load before the tag
- comments_popup_link without echo?
- Can’t filter wp_get_attachment_link
- Impossible to call wordpress function inside an include?
- How to customize the_archive_title()? Cannot figure out how to change the value it produces [duplicate]
- is there a way to remove featured image from blog page and single page
- Include the post type before the title of search results
- Adding additional roles on registration
- Problem with custom function when I go back with the browser
- How i can get the URL?
- How to add a custom thumbnail size for a specific category?
- Add version # to wp_register_style function
- How to remove font awesome from loading in wp theme
- Add custom css file after plugin css with WordPress Child Theme functions.php
- Remove check boxes and its label from screen option for custom role
- Change is_front_page() to is_page() to display ‘hero’ on entire site?
- Getting back a blank WordPress site following functions code edit
- Add functionality to post editor
- Adding function to function.php error 505 [closed]
- Vimeo video play button color function