layza
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Snippet in all pagesThanks @bcworkz, I tried what you said but it’s still not working.
In homepage the path is
<script src="https://becloudsolutions.com/wp-content/themes/thekeynote-v1-07/js/snippet.js" type="text/javascript"></script>
While in all other pages appears to be:
<script src="js/snippet.js" type="text/javascript"></script>
How it can be?
By the way, I also tried this in functions.php but it gave me the same problem. ??
function add_chat_scripts() { if ( is_page ()){ wp_register_script( 'chat', get_stylesheet_directory_uri() . '/js/chat.js' , array(), true ); wp_register_script( 'chat-snippet', get_stylesheet_directory_uri() . '/js/snippet.js', array('chat') ); wp_enqueue_script ('chat'); wp_enqueue_script('chat-snippet'); } } add_action( 'wp_enqueue_scripts', 'add_chat_scripts' );
Tnx
- This reply was modified 8 years ago by layza.
Forum: Developing with WordPress
In reply to: Snippet in all pagesThanks for replying.
I used the enqueu in functions, I am notte sure what you meam. But i have the sane problem. Working in homepage and not working in other pages.
Forum: Developing with WordPress
In reply to: ADD chat in WordPressThere was an error in the path for js.
Thank you for your help Steve, much appreciated! Have a nice day ??Forum: Developing with WordPress
In reply to: ADD chat in WordPressOk, thanks a lot. I tried but it still not working on the keynote theme, while is working ok on twentyseventeen. How it can be possible?
Forum: Developing with WordPress
In reply to: ADD chat in WordPressActually, I can see website homepage, but it gives me this error on any other page:
Fatal error: Call to undefined function wp_enque_script() in /home/content/n3pnexwpnas02_data01/42/2910242/html/wp-content/themes/thekeynote-v1-07/functions.php on line 123
Forum: Developing with WordPress
In reply to: ADD chat in WordPressThanks, I tried but it doesn’t work ??
Forum: Developing with WordPress
In reply to: ADD chat in WordPressHi Steve,
thank you for your answer.
I tried to do that, adding this in functions.php
wp_enqueue_script( 'chat', get_theme_file_uri( '/chat/js/chat.js' ), array(), true ); add_action( 'wp_enqueue_scripts', 'chat' );
And this
<script type="text/javascript" src="js/snippet.js"></script>
In the header.php right after the <body> tag. It worked on local with twentyseventeen, but it didn’t online with the other theme. Have I done something wrong?Thanks