badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

jnasevich

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • jnasevich
    Participant

    I already had that, of course. As I described in my previous post, problem was resolved when I removed the errant spaces between ?> <?php tags from the code that I had copied from the Attitude theme’s attitude_headerdetails() function in header-extensions.php. That eliminated the “Cannot modify header information – headers already sent by…” error message. Please fix this in the next release of the Attitude theme.

    jnasevich
    Participant

    I found blank spaces following one of the ?> <?php pairs in the Attitude theme’s attitude_headerdetails() function in header-extensions.php. When I copied this code into my own attitude_child_headerdetails() function and subsequently tried to save changes to the header, WordPress puked on it and generated the “Cannot modify header information – headers already sent by…” error message. Removing the errant blank spaces from the copied code eliminates the problem, and I’m now able to customize the child theme while maintaining use of the controls in the Theme Options section of the WordPress dashboard. Please fix this in the next release of the Attitude theme.

    jnasevich
    Participant

    @sanjipshah Child theme is extremely easy to make. I have made the changes you suggested and copied content inside the attitude_headerdetails function of parent theme, pasted it in the attitude_child_headerdetails. In fact, I have even reverted to a version without any customizations. As soon as one removes the parent function attached to the attitude_header hook, the controls in the Theme Options section of the WordPress dashboard no longer work. Please try this yourself, and let me know if the controls work for you:
    1 Create a child theme.
    2 Copy all the content inside the attitude_headerdetails function of parent theme, paste it in the attitude_child_headerdetails in child theme’s functions.php. DO NOT make any customizations. Unhook parent’s attitude_headerdetails and add attitude_child_headerdetails.
    3 Go to WordPress dashboard’s Theme Options section and change something, then try to save it. You will get error message similar to the one I had previously described.

    Now that you have seen this yourself, I’ll ask again. Is it possible to continue to use dashboard controls even after unhooking the Attitude theme’s attitude_headerdetails() function and replacing it with my own attitude_child_headerdetails() funtion? If so, how? I would prefer not to debug your code for you.

    jnasevich
    Participant

    @sanjipshah, thank you. Other than getting tripped up by mismatched quotation marks around names of actions and function names (I had to use straight quotation marks – I forgot how fussy PHP can be), your suggestion allows me to do what I need to do. Now, however, the controls in the Theme Options section of the WordPress dashboard no longer work. For example, in the Custom Header section, if I try to change the Header Menu Position from the default/left side to the right side and then click on the Save All Changes button, I get an error message saying, “Warning: Cannot modify header information – headers already sent by (output started at ./wp-content/themes/attitude-pro-child/functions.php:16) in ./wp-includes/pluggable.php on line 876.” I get the same error message if I try to change any other option in Theme Options section of the WordPress dashboard.

    Line 16 of my child theme’s functions.php is the start of the PHP code that removes parent’s attitude_headerdetails() function from attitude_header hook and replaces it with my own attitude_child_headerdetails() funtion. Line 876 of pluggable.php is the following line from function wp_redirect() in WordPress 3.5.2 (I have not upgraded to WordPress 3.6 yet):
    header(“Location: $location”, true, $status);

    Is it possible to continue to use dashboard controls even after unhooking the Attitude theme’s attitude_headerdetails() function and replacing it with my own attitude_child_headerdetails() funtion? If so, how?

Viewing 4 posts - 1 through 4 (of 4 total)