Tagged: x
-
AuthorPosts
-
September 19, 2016 at 4:26 am #1181080
freshhopeParticipantHi there support team!
I have tried adding some actions to my header for favicon and Moment.js, however I am getting this error or the normal enqueue of the parent stylesheet:
Fatal error: Call to undefined function add_filter() in /home/content/19/10640719/html/schoolhousecafe/wp-content/themes/x-child/functions.php on line 19
Here’s the code I’m trying to get working:
add_action( 'wp_head', 'x_custom_head_js' ); function x_custom_head_js(){ ?> <script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.15.0/moment.min.js"></script> <?php } add_action('wp_head','favicon_bits'); function favicon_bits() { echo '<link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png"/>'; echo '<link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png"/>'; echo '<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png"/>'; echo '<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png"/>'; echo '<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png"/>'; echo '<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png"/>'; echo '<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png"/>'; echo '<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png"/>'; echo '<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png"/>'; echo '<link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png"/>'; echo '<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/>'; echo '<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png"/>'; echo '<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/>'; echo '<link rel="manifest" href="/manifest.json"/>'; echo '<meta name="msapplication-TileColor" content="#ffffff"/>'; echo '<meta name="msapplication-TileImage" content="/ms-icon-144x144.png"/>'; echo '<meta name="theme-color" content="#ffffff"/>'; }Thanks!
September 19, 2016 at 4:40 am #1181105
Paul RModeratorHi,
Can you share to us the entire code in your functions.php file.
Thanks
September 19, 2016 at 4:55 am #1181122
freshhopeParticipantOf course Paul, thank you.
<?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_custom_head_js' ); function x_custom_head_js(){ ?> <script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.15.0/moment.min.js"></script> <?php } add_action('wp_head','favicon_bits'); function favicon_bits() { echo '<link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png"/>'; echo '<link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png"/>'; echo '<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png"/>'; echo '<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png"/>'; echo '<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png"/>'; echo '<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png"/>'; echo '<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png"/>'; echo '<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png"/>'; echo '<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png"/>'; echo '<link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png"/>'; echo '<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/>'; echo '<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png"/>'; echo '<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/>'; echo '<link rel="manifest" href="/manifest.json"/>'; echo '<meta name="msapplication-TileColor" content="#ffffff"/>'; echo '<meta name="msapplication-TileImage" content="/ms-icon-144x144.png"/>'; echo '<meta name="theme-color" content="#ffffff"/>'; }September 19, 2016 at 5:23 am #1181164
ThaiModeratorHi There,
Your entire code is working fine on my end.
In this case, 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 login to your site
– WordPress Admin username / Password
– FTP AccountDon’t forget to select Set as a private reply. This ensures your information is only visible to our staff.
Thanks.
September 19, 2016 at 5:54 am #1181194
freshhopeParticipantThis reply has been marked as private.September 19, 2016 at 7:11 am #1181255
Paul RModeratorHi,
I tried activating your child theme and didn’t get a fatal error.
Kindly check again in your end.
Thanks
September 19, 2016 at 8:51 am #1181424
freshhopeParticipantHi,
It appears that my server is down. I will check when it’s back up again.
Ollie
September 19, 2016 at 10:13 am #1181550
RupokMemberHey Ollie,
Thanks for updating and it’s still seems down and getting WordPress error. Let us know when you are ready.
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1181080 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
