Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #913932

    Matthew D
    Participant

    I’m trying to claim my Facebook Instant Articles URL

    And it is saying that I need to put this <meta property=”fb:pages” content=”1653689774900101″ />

    “To claim your website’s URL, add the following meta tag to your website’s <head> tag in the HTML and then specify the URL below.”

    Could you please guide me of where to put this quote at, my guess is somewhere in the editor.

    #914269

    Christian
    Moderator

    Hey Matthew,

    Please see this tutorial http://www.wpbeginner.com/plugins/how-to-add-header-and-footer-code-in-wordpress/ to learn how to add code to the <head> tag in WordPress.

    Thanks.

    #1053315

    khzidan
    Participant

    Hey amazing ppl,

    I have followed the link and did everything ti said but FB still shows error as the code is not included!!

    see attached pls

    cheers,
    khalid

    #1053764

    Rupok
    Member

    Hi Khalid,

    Thanks for writing back. You can try this instead as it supposed to add meta and the other one should add scripts – https://wordpress.org/plugins/add-meta-tags/

    Cheers!

    #1054773

    khzidan
    Participant

    Thanks but unfortunately your mentioned plugin is for SEO/Meta purpose for showing title, description in Search engine and social media. It is not for adding Meta Tags in <head>.

    what other options we have got here?

    #1054800

    khzidan
    Participant

    Hi,

    To explain further, I am not a technical person but I am trying to add my instant article for FB to my blog.

    I have added the tags as FB requested to head section using your plugin and many others:

    <meta property=”fb:pages” content=”1523012057993916″ />

    however GB still shows that the following error message:

    The fb:pages tag on the url doesn’t contain this page’s id. The url has fb:pages tag but they don’t have this page’s id. Please work with your developers / webmaster to add this tag to your website.

    can you help pls?

    cheers,
    khalid zidan

    #1055111

    Jade
    Moderator

    Hi Khalid,

    Please install the child theme and then activate it then add this code in the functions.php of the child theme:

    add_action('wp_head', 'custom_script');
    
    function custom_script() {
    ?>
        <meta property="fb:pages" content="1653689774900101" />
    <?php
    }

    Hope this helps.

    #1055216

    khzidan
    Participant

    oh come on guys! it messed up my whole site, see attached error!

    I had to fix it through FTP!

    what other solution you have got???

    #1055737

    Friech
    Moderator

    Hi There,

    I did test that code on my end, and I did not have that error. 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.

    Thanks.

    #1057075

    khzidan
    Participant
    This reply has been marked as private.
    #1057563

    Lely
    Moderator

    Hi There,

    I can’t connect to your server via FTP. See attached for the error.
    Can you add the code again on your child theme’s functions.php file. Make sure that you have copied the entire code. If the issue still exists, please post your functions.php file code here so we can see where the error coming from.

    #1058438

    khzidan
    Participant
    This reply has been marked as private.
    #1058649

    Jade
    Moderator

    Hi Khalid,

    It displayed an error since you edited the code incorrectly.

    Please do it this way:

    add_action('wp_head', 'my_tracking_pixel');
    
    function my_tracking_pixel() {
    ?>
        <!-- <!-- Facebook Pixel Code -->
    	<script>
    	!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
    	n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
    	n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
    	t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
    	document,'script','//connect.facebook.net/en_US/fbevents.js');
    
    	fbq('init', '440604012709948');
    	fbq('track', "PageView");</script>
    	<noscript><img height="1" width="1" style="display:none"
    	src="https://www.facebook.com/tr?id=440604012709948&ev=PageView&noscript=1"
    	/></noscript>
    	<!-- End Facebook Pixel Code -->
    <?php
    }

    Hope this helps.

    #1060533

    khzidan
    Participant

    Am I missing something?

    where is the code that I wanna add from the start?

    <meta property=”fb:pages” content=”1653689774900101″ />

    #1060751

    Rue Nel
    Moderator

    Hello There,

    Please update the contents of your child theme’s functions.php file. You can use this instead:

    <?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 Tracking Pixel
    // =============================================================================
    function my_tracking_pixel() { ?>
    
    	<!-- Facebook Pixel Code -->
    	<script>
    	!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
    	n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
    	n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
    	t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
    	document,'script','//connect.facebook.net/en_US/fbevents.js');
    
    	fbq('init', '440604012709948');
    	fbq('track', "PageView");</script>
    	<noscript><img height="1" width="1" style="display:none"
    	src="https://www.facebook.com/tr?id=440604012709948&ev=PageView&noscript=1"
    	/></noscript>
    	<!-- End Facebook Pixel Code -->
    
    <?php }
    add_action('wp_head','my_tracking_pixel');
    // =============================================================================
    
    // Add Custom Script
    // =============================================================================
    function custom_script() { ?>
        <meta property="fb:pages" content="1653689774900101" />
    <?php }
    add_action('wp_head', 'custom_script');
    // =============================================================================

    Please let us know if this works out for you.