Bring your own theme to PHP 8

I have found the error. In the header.php an undefined constant was tried to be accessed. So instead of the following wrong code: <?php if ($pagetitle == pagetitle_1){ $pt1 = “pagetitle_1”; $main = “main_1”; } else { $pt1 = “”; } ?> I had to add the quotation marks to pagetitle: <?php if ($pagetitle == … Read more

Modify the permalink structure for a specific category

A user posted several correction ideas; unfortunately, they were deleted, but I managed to remember some things and apply them to the code. The 404 error no longer appears; now it generates the following: Try deleting cookies. ERR_TOO_MANY_REDIRECTS add_filter(‘post_link’, ‘custom_permalink’, 10, 3); function custom_permalink($permalink, $post, $leavename) { $categories = get_the_category($post->ID); $news_category = array_filter($categories, function ($category) … Read more