Site logo

Archived topic

header.php in a child theme: Call to undefined function generate_do_attr()

3 replies · Started by Rafal on October 12, 2021

Viewing posts 1–4 of 4

Hi,

I have copied header.php from the template into the child theme folder and now I am getting this problem:

Error thrown
Call to undefined function generate_do_attr()

How to solve it?

Hi there,

what changes are you wanting to make the header.php ? As you may not need to make a copy of it. Let me know.

I think I found a problem. We do use BETA versions on wp-dev instances where the theme is 3.1-beta and production is currently on 3.0.4 . Someone has changed the names of functions.

from 3.0.4:
generate_do_element_classes( 'page' );

to 3.1:
generate_do_attr( 'page' );

bit incompatibility when having child themes - and possibly require updating all of them manually after 3.1 will be released.

Hi there,

It's not required to update your child themes with the new generate_do_attr() function, it will continue to work with generate_do_element_classes().

If you do update your child themes to use this new function, you need to make sure 3.1 is installed so the new generate_do_attr() function exists.

So if you're using 3.0.4, stick with generate_do_element_classes().

Once you update to 3.1.0, you can choose to switch to generate_do_attr() whenever is convenient for you.

This archived topic is closed to new replies.