Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #374217
    Ben
    Participant

    I created a child them “renew” stack and added the following to functions.php (I got this from one of the other forum posts – in fact it was the third one since the others all had some php code problems)

    add_action(“wp_head”, “x_add_google_code”);
    function x_add_google_code(){
    ?>
    <meta name=”google-site-verification” content=” my verification code” />
    <?php
    }
    However, when I go to “view source” the meta tag has not been added.

    Also, there is a problem with my homepage. The recent posts is not acting correctly. There is only 1 post selected, yet it looks like it is trying to show 2. It looks fine in cornerstone.

    Here is the complete functions.php

    <?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", "x_add_google_code");
    function x_add_google_code(){
      ?>
      <meta name="google-site-verification" content="my verification code" />
      <?php
    }
    <?php });
    

    My site:
    ielts7.guru

    #374224
    Paul R
    Moderator

    Hi,

    Please replace the entire code in your functions.php file with this.

    
    <?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", "x_add_google_code",99999);
    function x_add_google_code(){
      ?>
      <meta name="google-site-verification" content="my verification code" />
      <?php
    }
    

    Hope that helps.

    #374250
    Ben
    Participant

    I have done this but I still can’t see it in the source code:
    view-source:http://www.ielts7.guru/

    Is there some child theme set up I have missed? Also, the problem with recent-posts is still there.

    #374255
    Paul R
    Moderator

    Hi,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #374277
    Ben
    Participant
    This reply has been marked as private.
    #374286
    Thai
    Moderator
    This reply has been marked as private.
    #374309
    Ben
    Participant

    The problem was I had put the new functions.php in the x-child/framework/views/renew ,which was what I thought I should do based on the documentation and forum posts.

    I moved it to x-child/ and now the site works – except I STILL CAN’T see that the google verification code is in place.

    #374312
    Thai
    Moderator

    Hi There,

    Upon checking your website’s source, I can see the Google Verification Code:

    Regards!

    #374324
    Ben
    Participant

    Great! Thanks!

    #374339
    Paul R
    Moderator

    You’re welcome!

    #605187
    Seth R
    Participant

    I need to add verification code for Google Work Apps and Analytics. I’m using the standard theme. No Child.

    Any suggestions?

    Thanks!

    #605230
    Prasant Rai
    Moderator

    Hello Seth,

    Thanks for writing in!

    To setup Google apps kindly walk-through following thread:

    https://community.theme.co/forums/topic/adding-googles-verification-meta-tag/

    To implement Google Analytics, kindly use Google Analytics plugin that comes with X theme package.

    Thanks.

  • <script> jQuery(function($){ $("#no-reply-374217 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>