Script not working in post content

Put this markup where you would like to before footer. you can put this markup in page editor text mode too. But doing so will remain in that page alone. so place it in template files. Search: <input type=”text” id=”fname” > <a id=”sear” href=”” target=”_blank”>Search</a> write a function and hook it to wp_footer, place the … Read more

JavaScript and Google PageSpeed + wp_enqueue_script

You can copy this code to a JS file then enqueue that to wordpress . For Ex : Copy codes to scripts.js in js folder , then in functions.php write : function enqueue_scripts() { wp_register_script(‘scripts’, get_template_directory_uri(). ‘/js/scripts.js’,”, ”, true); wp_enqueue_script(‘scripts’); } add_action( ‘wp_enqueue_scripts’,’enqueue_scripts’ );

Combining results from WP-API using AngularJS

I’ll assume the html you posted is a template that is part of a theme or plugin where you can interact with the page loading routines. You do not need to load jQuery, it is already loaded by WordPress. Instead, you should leverage the script loading system. The third parameter in wp_enqueue_script states dependencies: my-app … Read more

how to do open a link in a open window from menu bar? [closed]

Please add below code to bottom of your functions.php, I have replaced with your menu item ID function lidget_popup_link() { ?> <script type=”text/javascript”> jQuery(window).load(function() { var width = “680”, /* Enter popup window width here */ height = “480”, /* Enter popup window height here */ menuItem = “menu-item-140”, /* Enter menu item ID */ … Read more

Create new product with woocommerce REST API with javascript (clientside)?

If you’re using SSL (HTTPS URL) you don’t need to use oauth1.0 with oauth signature and everything. All you need to do is pass in the consumer_key and consumer_secret in the url https://localhost/wpShop/wc-api/v2/products?consumer_key=ck_1111111111122123&consumer_secret=cs_232332322233232 That’s it! However, if your URL is NOT SSL, then you have to go to the trouble of creating an HMAC-SHA1 keys … Read more