• Resolved samidmatt

    (@samidmatt)


    Hi, I was following instructions in terms of how to create a child theme. In any case, I get the following error on my admin login page:

    Warning: Cannot modify header information – headers already sent by (output started at /home/content/21/10535121/html/wordpress/examples/template_one/wp-content/themes/Revera-child/functions.php:1) in /home/content/21/10535121/html/wordpress/examples/template_one/wp-includes/pluggable.php on line 1121

    This is line 1121
    header("Location: $location", true, $status);

    This is my functions page in my child theme, and I do realise that the problem is the code here. But I can’t for the life of me figure out why it interferes

    <?php
    
    function my_updated_copyright($first_year, $owner) {
    	$copyright_notice = '&copy; ' . $first_year;
    	$current_year = date('Y');
    	if($first_year != $current_year) {
    		$copyright_notice .= ' - ' . $current_year;
    	}
    	$copyright_notice .= ' ' . $owner;
    	return $copyright_notice;
    }
    
    ?>

Viewing 6 replies - 1 through 6 (of 6 total)
  • I’m sorry but as you appear to be using a non-WPORG theme, you need to seek support from the theme’s developers – paid or otherwise. We only support themes downloaded from www.remarpro.com here. Placing the theme name in square brackets does not means we can support it here. Try https://www.fabthemes.com/

    Thread Starter samidmatt

    (@samidmatt)

    Ok. I sent one there. But, nonetheless, I’m still wondering if I’ve properly created the functions page in the child version. I know WordPress itself explains how to create the child themes. To your knowledge, have I properly created my functions page?

    Impossible to say for sure just looking at that code snippet. Have you reviewed Try reviewing Solving “headers already sent” warnings?

    Thread Starter samidmatt

    (@samidmatt)

    No, that’s not a snippet. That is the entirety of the child function code lol. I wanted to merely test the functions page to make sure it would appear before trying more extensive functions ??

    Thanks, I took it for granted that the way I saved it was in fact the correct way. Or rather, with the correct encoding. However, I had not. I had encoded it using BOM8. So I removed it, and now it works as it should.

    I thought it might be that. This is exactly the kind of thing we cannot check for when you post code here. Glad to hear that you got it sorted. ??

    Thread Starter samidmatt

    (@samidmatt)

    I thought it might have been something to do with having to put in extra coding at the beginning or something of that nature. Since WordPress is not very explicit with their explanation about creating a child function. So, I’m glad as well ?? Thank goodness it was only removing the bom encoding. Thanks again!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Theme: Revera] Child theme: PHP error output header’ is closed to new replies.