Tagged: x
-
AuthorPosts
-
July 6, 2016 at 11:00 am #1074987
Super RainbowParticipantHi I understand we have to install a child theme to insert the facebook pixel code. Here is my functions.php file. Not sure where do I insert the code.
<?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
// =============================================================================July 6, 2016 at 12:42 pm #1075126
RahulModeratorHey There,
Thanks for posting in!
What you are trying to accomplish requires a template customization, we would like to suggest that you use a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
Once your child theme is set up, you can insert the code below in your child theme’s functions.php
// Add Facebook custom audience pixel Code // ============================================================================= function add_facebook_audience_pixel_code(){ ?> <!-- Insert Facebook custom audience pixel Code starts here --> The Facebook custom audience pixel Code should be place here <!-- Insert Facebook custom audience pixel Code Code ends here --> <?php } add_action( 'wp_head', 'add_facebook_audience_pixel_code' ); // End Facebook custom audience pixel Code // =============================================================================Please make sure to insert the javascript code in the designated area. Here, You can add this code at the end of your functions.php file.
Please let us know how it goes.
July 6, 2016 at 12:46 pm #1075135
RahulModeratorHey There,
Thanks for posting in!
What you are trying to accomplish requires a template customization, we would like to suggest that you use a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
Once your child theme is set up, you can insert the code below in your child theme’s functions.php
// Add Facebook custom audience pixel Code // ============================================================================= function add_facebook_audience_pixel_code(){ ?> <!-- Insert Facebook custom audience pixel Code starts here --> The Facebook custom audience pixel Code should be place here <!-- Insert Facebook custom audience pixel Code Code ends here --> <?php } add_action( 'wp_head', 'add_facebook_audience_pixel_code' ); // End Facebook custom audience pixel Code // =============================================================================Please make sure to insert the javascript code in the designated area. Here, You can add this code at the end of your functions.php file.
Please let us know how it goes.
July 7, 2016 at 1:42 am #1076006
Super RainbowParticipantThanks Rahul for your reply.
I’ve already installed the child theme before this post. When I go to the functions.php file, it shows me 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
// ===========================================================================It’s different from what you show me. Do I need to reinstall the child theme?
July 7, 2016 at 3:12 am #1076087
FriechModeratorHi There,
No, you got the right functions.php file 🙂
What you need to do is append the code Rahul provided. Just below that line:
// Additional Functions // ===========================================================================And then replace the phrase: The Facebook custom audience pixel Code should be place here
With your actual pixel code.
Hope it helps, Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1074987 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
