Disable portfolio item page and portfolio category archives

I want to disable portfolio category archives. How do I do that? I have this code added in my functions.php file but I think this only disables blog category archives.

function meks_remove_wp_archives(){
if( is_category() || is_tag() || is_date() || is_author() ) {
global $wp_query;
$wp_query->set_404();
}
}

add_action(‘template_redirect’, ‘meks_remove_wp_archives’);

Also, I would like to disable each portfolio item page. How do I do that?

If I can redirect users to any particular page when they try to access this link, that should work.

Hi Malav,

Thank you for writing in, I know your request sounds simple but unfortunately, we can not provide support for any customization, you can use a plugin like 301 Redirects to do redirection on those pages.

Hope it helps,
Cheers!

Hi!!

The plugin you sent doesn’t have any such option in its free version.

I think I have a solution. Can you tell me which files do I have to edit in the file manager to edit portfolio archive page and portfolio single page? I’m using Integrity stack.

Hi Malav,

Please check the screenshot of the referred plugin, you can find the option shown in it.

I would suggest you use the plugin and not modify any files. Please note that we strongly discourage editing the theme core files.

Hope it helps.
Thanks

Hi!

Thanks, I went with the pro plugin and that sorted things out.

Glad to hear that Malav.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.