• I was working with my child functions.php file trying to solve a PHP problem about the order to enqueue the parent and child styles. I had added code exactly like the code on the Codex https://codex.ww.wp.xz.cn/Child_Themes page. The warning directed me to re-read that page. I verified that my code matched. I looked at your Aaron functions.php file and saw that you already have an enqueue statement for a child theme so I deleted the one I’d put in mine to test it. My child style still worked but I still got the PHP Notice.

    I am wondering if the notice is talking about the enqueue statements in Aaron’s functions.php file since I’m not enqueueing anything now. Here is the notice:

    PHP Notice: wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.) in /home/stcwdc57/public_html/dev.stcwdc.org/wp-includes/functions.php on line 4161

Viewing 1 replies (of 1 total)
  • Theme Author Carolina Nymark

    (@poena)

    Hi
    I made a new blank child theme to test with, but there were no php notices.
    Would it be possible for me to see your child theme files?
    Did you make any changes to plugins recently?

    The parent themes script and styles are correctly hooked with
    wp_enqueue_scripts, admin_enqueue_scripts and enqueue_block_editor_assets for the new editor.

Viewing 1 replies (of 1 total)

The topic ‘PHP Notice: wp_enqueue_style was called incorrectly.’ is closed to new replies.