Problem:
The issue here is that the user wanted to disable their taxonomy archives.
Solution:
This can be done with the code below.
/**
* Disable the taxonomy archive pages
*/
add_action('pre_get_posts', 'jb_disable_tax_archive');
function jb_disable_tax_archive($qry) {
if (is_admin()) return;
if (is_tax('tax-slug')){
$qry->set_404();
}
}
Add the above to your custom code section in Toolset -> Settings -> Custom Code and ensure that you've activated the code.
Finally change the 'tax-slug' to the slug of the taxonomy that you want to disable the archive for.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| - | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | - |
| - | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | 14:00 – 18:00 | 13:00 – 18:00 | - |
Supporter timezone: America/Jamaica (GMT-05:00)
This topic contains 4 replies, has 2 voices.
Last updated by 4 years, 10 months ago.
Assisted by: Shane.