Site logo

[Support request] Getting a PHP error for theme

Home Forums Support [Support request] Getting a PHP error for theme

Home Forums Support Getting a PHP error for theme

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1260439
    NIck

    I am getting this in my theme

    Warning Use of undefined constant HTTP_USER_AGENT – assumed ‘HTTP_USER_AGENT’ (this will throw an Error in a future version of PHP)
    1 + wp-content/themes/generatepress_child/header.php:1
    Core

    #1260440
    Leo
    Staff
    Customer Support

    Hi there,

    The error is pointing to the header.php file in the child theme folder which shouldn’t be there by default.

    Did you actually need to modify that file?

    #1260441
    NIck

    Hello,

    What would I be modifying?

    #1260448
    Leo
    Staff
    Customer Support

    You don’t need the header.php file in your child theme folder at all if you aren’t modifying it

    #1260449
    NIck

    Ok, I am not getting this error on my local site

    #1260451
    Leo
    Staff
    Customer Support

    By default, the child theme folder should only consists two files: function.php and style.css.

    Anything else in there is extra unless you are modifying them.

    You can download a fresh child theme if you’d like:
    https://docs.generatepress.com/article/using-child-theme/#installing-a-child-theme

    #1260477
    NIck

    OK, reason I have this is for extra header code…
    I found BOT code which I have deleted and fixed the error.
    Not sure how as I use word fence.

    #1260523
    Leo
    Staff
    Customer Support

    Not sure what’s the code you are adding but you could also consider using the wp_head hook with a hook element:
    https://docs.generatepress.com/article/hooks-element-overview/

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.