410 response header for deleted posts

Posted in: Newspaper
Post count: 27

Hi,
I managed to change the 404 response for non-existing / deleted posts to a 410 by modifying
wp-content/plugins/td-cloud-library/wp_templates/tdb_view_404.php

added : header($_SERVER[“SERVER_PROTOCOL”] . ” 410 Gone”);

It would be much better that I could that in the child-theme functions. As when the theme will update the code will be removed.

I would even prefer that I could create a special page for the 410 response like doing something like this:

$custom_410_page_ID = 76761;//Error 410 page ID
header($_SERVER[“SERVER_PROTOCOL”] . ” 410 Gone”);
header(“Refresh: 0; url=” . get_permalink($custom_410_page_ID));

Could you explain how I can add this functionality in the child theme?

https://myrocknews.com

Post count: 21065

Hello @Dibbes !

We have a template for 404 only. A guide for the child theme, you can find here: https://forum.tagdiv.com/the-child-theme-support-tutorial/

Thank you!

Post count: 27

Hi Bettina,
As I wrote, I’m using a child theme. But because of the template are from the plugin td-cloud-library I was wondering how to override the behavior of this template in the child theme. So I make a proper use of the childtheme.

Thank you

Post count: 21065

Hello @dibbes !

Unfortunately, this can not be overwritten in the child theme, only the default templates from the Standard Pack plugin.

Thank you for understanding!

Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.