• stefanocps

    (@stefanocps)


    HYello i need to insert code in the head section and iht body section (tracking google code and similar)

    I don’t want to use a plugin and i want to write straigh tin thephp file sof my theme

    I have created a child theme…but don’t know how to go on

    I have tried different tutorial form google , iset codes infunction-php but the site break down

    Any help?thanks

Viewing 9 replies - 16 through 24 (of 24 total)
  • Thread Starter stefanocps

    (@stefanocps)

    when i add the code the error is on the 1st line of the code i add

    Benjamin Zekavica

    (@benjamin_zekavica)

    Please check your wp-config.php again. Somewhere in the File was set double WP_DEBUG_LOG. Remove one of them and add only this:

    define('WP_DEBUG_LOG', true)

    Thread Starter stefanocps

    (@stefanocps)

    oh yes but that don’t change the main problem

    Benjamin Zekavica

    (@benjamin_zekavica)

    Yes but I need an error message than I can help you, that is the reason why I need the debug log to find the error. Do you can rename your functions.php to __functions.php in your Child Theme? Than we can see if the parent theme works fine.

    Currently you said you want to add Code to Header / Footer. The solution is to write it inside your theme with php or to use a plugin: https://de.wordpress.org/plugins/header-footer-code-manager

    Thread Starter stefanocps

    (@stefanocps)

    with functions.php renamed it is still fine but wth this error

    Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/greenartcoin/domains/greenartcoin.eu/public_html/wp-includes/formatting.php on line 4494

    Benjamin Zekavica

    (@benjamin_zekavica)

    Remove the WP_Debug from true to false. It’s only Deprecated Function. Maybe you have to set up your PHP to 8.0

    Thread Starter stefanocps

    (@stefanocps)

    tried several php version..always error

    Benjamin Zekavica

    (@benjamin_zekavica)

    Sorry it sound’s that you have a theme error. Maybe you need to create a new Thread with all detailed information of you theme etc. Here in this Thread you only asked, how to add code to header and etc.

    Add in the new Thread WP: specifices

    Copy it from Tools->Site Health->Info
    Press the button: Copy site info to clipboard

    Hey @stefanocps ,

    I think below plugin easy to add code in header, footer and body . So you can try any one plugin.
    https://wordpress.org/plugins/insert-headers-and-footers/
    https://wordpress.org/plugins/wp-headers-and-footers/

Viewing 9 replies - 16 through 24 (of 24 total)
  • You must be logged in to reply to this topic.