Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1038482
    khzidan
    Participant

    I added a function to functions.php in child theme but the website is not working now getting this error:

    Parse error: syntax error, unexpected ‘<‘ in /home/content/p3pnexwpnas14_data01/52/2915852/html/wp-content/themes/x-child/functions.php on line 26

    and of course I have no access to wordpress admin.

    I have deleted the function infunctions.php in cpnael–>public_html/wp-content/themes/x-child

    but still not working.

    i have tried so many things and nothing is working!

    pls help

    #1038484
    khzidan
    Participant
    This reply has been marked as private.
    #1038953
    Rad
    Moderator

    Hi there,

    Thanks for writing in. It can only fix through file manager or FTP. Would you mind providing your FTP login credentials?

    Thanks!

    #1039092
    khzidan
    Participant
    This reply has been marked as private.
    #1039093
    khzidan
    Participant

    we have tried both FTP and file manager in cpanel, but we till see the error. tried to disabled chile theme and still see the error

    #1039147
    Rue Nel
    Moderator

    Hello There,

    Thanks for providing the ftp details. I went ahead and edited your child theme’s functions.php file. I change the code:

    
    // =============================================================================
    // 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
    // =============================================================================
    
    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');

    After saving the file, still no change in your site. Normally, it should have been resolve, but in your case, it doesn’t. Can you please confirm that we are on the correct directory?

    Are you using CloudFlare or any CloudHosting with caching or may have installed a caching plugin like WordFence, W3 Total Cache or WP Super Cache? Please keep in mind that after doing every updates, always remember to clear all caches when updating so that the code from the latest release is always in use. This will help you to avoid any potential errors.

    Please let us know how it goes.

    #1039155
    khzidan
    Participant

    Exactly, this is the problem we face! it does not work!

    We do not use any cache plugin or CloudFlate however we use Sucuri.net for security.

    What else can we do??

    #1039172
    khzidan
    Participant
    This reply has been marked as private.
    #1039200
    Christopher
    Moderator

    Hi there,

    Please update your code to :

    <?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
    // =============================================================================
    
    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');

    Hope it helps.

    #1039214
    khzidan
    Participant

    guys! come on pls! we have tried this already… it is not working! and it is driving me crazy! we noticed already the open tag for php but still not working!

    #1039268
    Rue Nel
    Moderator

    Hello Again,

    Could please disable your caching feature in Sucuri?

    I have change back the contents of the functions.php to the original content like the one below and still no change.

    <?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
    // =============================================================================
    
    

    Are you sure we are connecting on the correct directory? Because even if we removed the custom functions, it doesn’t seem to have a effect in your site. There must be a caching issue in your server. Maybe you can ask assistance from your host.

    Hope this helps. Kindly let us know. Thank you.

    #1039925
    khzidan
    Participant

    man, we have tried all this already, you know what! never mind, I am hiring a developer, I have lost too much time..

    #1039996
    Rahul
    Moderator

    Hey There,

    Please let us know if there’s anything else we can help you with.

    Thanks

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