Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1344516

    Hello
    Participant

    Hi,
    Please could you check my child theme header.php file is supposed to be what it is and the path is correct. My current path is:

    public_html/wp-content/themes/x-child/framework/views/icon

    But in a forum posts it says:

    x-child/framework/views/global/_header.php

    I don’t have a global folder. Is that a problem and is that why some codes don’t work?

    My header file is called wp-header.php which is different from the header.php file name.

    This is the post used from you for reference.

    How to Add Code to Header?

    I am trying to add code before the </head>.

    <script type=”text/javascript” src=”//s3.amazonaws.com/downloads.mailchimp.com/js/signup-forms/popup/embed.js” data-dojo-config=”usePlainJson: true, isDebug: false”></script><script type=”text/javascript”>require([“mojo/signup-forms/Loader”], function(L) { L.start({“baseUrl”:”mc.us14.list-manage.com”,”uuid”:”ebac4671407f5b47c8da65032″,”lid”:”df9a7107f7″}) })</script>

    Thank you.

    #1344517

    Hello
    Participant
    This reply has been marked as private.
    #1344729

    Thai
    Moderator

    Hi There,

    In this case, you don’t have to copy the template to child theme.

    Please add the following code under functions.php file locates in your child theme:

    add_action( 'wp_head', 'add_custom_script' );
    function add_custom_script(){
    	?>
    		<script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script><script type="text/javascript">require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us14.list-manage.com","uuid":"ebac4671407f5b47c8da65032","lid":"df9a7107f7"}) })</script>
    	<?php
    }

    Regards!

    #1344739

    Hello
    Participant
    This reply has been marked as private.
    #1344929

    Lely
    Moderator

    Hello There,

    From the previous code suggested by Thai, this part :wp_head means that the code inside the function will be added on the header part of the site. See this link on how hook works on wordpress: https://codex.wordpress.org/Plugin_API/Action_Reference/wp_head

    #1344968

    Hello
    Participant
    This reply has been marked as private.
    #1345208

    Jade
    Moderator

    Hi there,

    Please provide us with your site URL and the FTP details so that we can check.

    Thank you.

    #1345411

    Hello
    Participant
    This reply has been marked as private.
    #1345778

    Darshana
    Moderator
    This reply has been marked as private.
    #1346120

    Hello
    Participant
    This reply has been marked as private.
    #1346146

    Lely
    Moderator

    Hi There,

    I am able to add the code. Although, I am not sure what went wrong when you add it.
    This is how your child theme’s functions.php look like now:

    <?php
    
    // =============================================================================
    // FUNCTIONS.PHP
    // -----------------------------------------------------------------------------
    // Overwrite or add your own custom functions to X in this file.
    // =============================================================================
    
    // =============================================================================
    // TABLE OF CONTENTS
    // -----------------------------------------------------------------------------
    //   01. Enqueue Parent Stylesheet
    //   02. Additional Functions
    // =============================================================================
    
    // Enqueue Parent Stylesheet
    // =============================================================================
    
    add_filter( 'x_enqueue_parent_stylesheet', '__return_true' );
    
    // Additional Functions
    // =============================================================================
    add_action( 'wp_head', 'add_custom_script' );
    function add_custom_script(){
    ?>
    <script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script><script type="text/javascript">require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us14.list-manage.com","uuid":"ebac4671407f5b47c8da65032","lid":"df9a7107f7"}) })</script>
    <?php
    }

    Another issue I notice on your site is you have an extra < on top of this text:FREE UK NEXT DAY DELIVERY. To check where it is coming from, you may backup entire child theme, then remove all file. Add each file one by one and check after each file.

    Hope this helps.

    #1346158

    Hello
    Participant

    Hi,
    Adding the code is not a problem. The problem is that the pop up does not appear even with the code.

    Can you advise?

    Also how do I backup entire child theme, then remove all files. Then add each file one by one and check after each file?

    Please tell me the complete steps.

    Thank you.

    #1346287

    Lely
    Moderator

    Hello There,

    Can you try clearing cache? It seems that the code was added 3 times. See this:http://screencast-o-matic.com/watch/cbVOIYQMR5
    There’s a javascript error too. See attached screenshot.
    Upon thorough checking, I found the following code on Appearance > Customize > Custom > Edit Global CSS:
    <div style="float:right; margin-right: 0; margin-top: 4px;"><a style="font-size: 11px; color: black;" href="mailto:contact@trillionpeak.com"> CONTACT <i class="x-icon x-icon-envelope" data-x-icon="" aria-hidden="true"></i></a></div></i></div>
    Please remove that. It is not a CSS code.
    Some javascript errors are pointing to Facebook pixel code. But then it is not part of your functions.php file. Did you add it somewhere? If not, we might be seeing cache content. Clear cache first before checking. We have to clear those errors first.

    1.) Backup your site. This is important.
    2.) We need to check where that extra < is coming from -from your child theme files. How? Switch to main X theme. Check your site after. If that extra < is gone, this means that one file is causing this.
    3.) We need to know which file. By process of elimination. You may download entire child theme folder using FTP and save a copy on your local computer.
    4.) Since you have a backup on your local computer, you may delete this x-child folder from your site here wp-content/themes/x-child
    5.) Download a clean copy of X child theme and upload it here : wp-content/themes.
    6.) Activate the child theme( This is fresh with no customization yet)
    7.) From your backup child theme, upload each file on the same folder on your fresh child theme.
    8.) After every upload, check your site.

    Hope this helps.

    #1346391

    Hello
    Participant

    Hi,
    I have removed two of the codes using Insert Headers and Footers plugin in Settings. That’s were the two codes were. The third is in the Header and Footer plugin in Settings.

    I have also cleared the cache without the pop up showing.

    What is the significance of the javascript error in the screenshot? What problems is it causing? Can you help clear it up?

    I have removed the code in the Global CSS:

    <div style=”float:right; margin-right: 0; margin-top: 4px;”> CONTACT <i class=”x-icon x-icon-envelope” data-x-icon=”” aria-hidden=”true”></i></div></i></div>

    What problems was it causing?

    A Facebook pixel code is in the Insert Headers and Footers plug in in Settings. What javascript errors is it producing? The pixel works as it is sending data to Facebook.

    Can you help fix these without disturbing the pixel?

    1/ How do I backup the site?

    2/ How do I switch to the main x theme?

    3/ How do I download entire child theme folder using FTP?

    4/ By deleting the x-child folder, does that remove it from the root tree? Or do you mean just delete the contents of the folder?

    5/ How do I download a clean copy of X child theme?

    6/ When uploading it here : wp-content/themes, does the CMS allow users to choose the folder to upload to?

    7/ How do I activate the child theme?

    8/ When uploading each file in the same folder on the fresh child theme, how many files are there in each folder?

    Do you mean to check after each individual file in each folder? Or can I batch upload to each folder?

    Thank you.

    #1346533

    Joao
    Moderator

    Hi There,

    1/ How do I backup the site?

    You can use a plugin like backup buddy.

    2/ How do I switch to the main x theme?

    Go to Appereance > Themes > Select X

    3/ How do I download entire child theme folder using FTP?

    Access your website via FTP or Cpanel and download it just as you work on your computer files.

    4/ By deleting the x-child folder, does that remove it from the root tree? Or do you mean just delete the contents of the folder?

    Yes if you remove child theme it will remove the child theme completely and you will be able to install a fresh one

    5/ How do I download a clean copy of X child theme?

    Child Theme

    6/ When uploading it here : wp-content/themes, does the CMS allow users to choose the folder to upload to?

    Please use the original folder x-child

    7/ How do I activate the child theme?

    Go to Appereance > Themes and select your Child Theme

    8/ When uploading each file in the same folder on the fresh child theme, how many files are there in each folder?

    I do not understand the question, but you can download a fresh copy and take a look, than you can add the files depending on the changes you are aiming for.

    Do you mean to check after each individual file in each folder? Or can I batch upload to each folder?

    Let us know when it is done.

    Cheers

    Thank you.