A client side scripting language useful for making interactive web sites

learn more… | top users | synonyms

1
vote
2answers
625 views

How to add a onclick attribute to a list of checkboxes?

I have this array for checkbox: array( 'name' => __('Latest Product',''), 'desc' => __('Select if you want to display latest product',''), 'id' => $prefix . 'checkbox'...
1
vote
0answers
34 views

wp_enqueue JavaScript in child-theme (ReferenceError)

This is my first post here, so I hope I pasted the code well and you'll stand by interpreting the problem. I have deregistered and dequeued two scripts in my childtheme. When removing and adding ...
0
votes
1answer
37 views

Where to find the html for Wordpress site?

Where can I find the HTML for a Wordpress site? I'm using the "X" child theme. I found a tutorial explaining how to achieve an effect that I want and it says that "All I need is an HTML markup and to ...
0
votes
1answer
33 views

Converting HTML to Wordpress theme: integrating pages function and using its text editor, conditional enqueuing

Recently I attempted to convert my static HTML to a Wordpress theme but to no avail. I was able to understand how to separate my code for my header, content, and footer, and I integrated the header ...
0
votes
1answer
3k views

Ajax page load without reload

I am working on a script to load my page without refreshing. It is working as I want it except for one thing. The test site I have up is http://dev.dog-company.com . Only home About us and FAQ will ...
0
votes
1answer
1k views

Dropdown parent link not working in mobile

I'm working on WordPress with Bootstrap. The WP Menu dropdown parent link is not working on a mobile device. Here is the JavaSript: <script> jQuery(function ($) { $('.navbar ....
3
votes
1answer
57 views

How to preserve PHP modifications while upgrading WordPress?

I made a lot of custom modifications in the PHP code of my WordPress blog. Namely in: archive.php, blog.php, footer.php, functions.php, header.php, search.php To provide customized search results, ...
0
votes
0answers
10 views

Implement a layout for feautured images on a single category

This is kinda hard to explain but here we go, im trying to use the flex laytout from Freewall for my posts featured images on my category of "gallery", i want only the featured image to display the ...
0
votes
0answers
18 views

Code is transforming [closed]

Whenever I type in the following code in a code snippet... nfspothead?&currency=cad"; The text gets transformed to this... nfspothead?¤cy=cad"; Any ideas why? Thanks in advanced https://...
0
votes
1answer
23 views

Combine CSS and JS files from plugins

I want to combine all my CSS and JS files. Given the fact that I use different plugins I don't see a way to do this manually because after an update of the plugin I have to start all over. So I did ...
0
votes
0answers
18 views

AJAX call to Vimeo API from WP admin

What I am trying to do is query the Vimeo API to populate some ACF fields in a custom post type. I'm loading this in the admin head for WP Editor, which grabs the Vimeo URL from the ACF field, and ...
0
votes
0answers
8 views

Positioning the top attribute of a element with jquery [migrated]

I'm having an annoying issue trying to position the responsive navigation hamburger. I am using a plugin called responsive menu which creates the hamburger and uses absolute positioning. I am trying ...
-1
votes
2answers
33 views

javascript not loading in wordpress

I originally posted this in the stackoverflow, but I believe it is better posted here as I am using wordpress and a wordpress function. I am trying to add the jquery cycle plugin (http://jquery....
0
votes
0answers
9 views

Get a color name from any RGB combination (script included) [migrated]

i am returning a hex and an RGB color in my app (from camara) and i want to use a script to identify that color and display a name... ive found http://gauth.fr/2011/09/get-a-color-name-from-any-rgb-...
0
votes
1answer
23 views

customizer live preview layout picker

I'm trying to create a layout picker option using the wordpress customizer. What i've done so far works except for the live preview. when i change an option in the customizer for example left sidebar ...
1
vote
0answers
20 views

Wordpress Media frame pre load images from ids

Im using custom metabox button to create wp media frame with this code, var frame, selection, idsField = $('#_fills_ids'); frame = wp.media({ title: 'Select or Upload Media Of ...
1
vote
3answers
2k views

Run shortcode at certain resolution

I've gone a roundabout way of trying to ask a question about this here: Loading shortcode with ajax but figured it might be worth asking the fundamental question of what I am trying to do without ...
0
votes
1answer
27 views

Move jQuery on *top* of footer

I am using this code by Peter Wilson to move jQuery to footer: function pwcc_jquery_to_footer( &$wp_scripts ) { if ( is_admin() ) { return; } /* Move jQuery to the ...
13
votes
2answers
2k views

Executing Javascript When a Widget is Added in the Backend

I have widgets that have javascript controls attached to them. If the widget is present when the widget admin page loads, the controls work correctly. When I add a new widget, they do not work ...
0
votes
0answers
10 views

Register a menu onclick function

I am trying to add this in an abc.php file where add_footer_menu() is a onclick function. This is showing me the "Menu added." but menu is actually not generating. <script type="text/javascript"&...
-1
votes
1answer
508 views

Theme now uses require.js and enqueue script no longer works

I created a small custom script that fixes a sidebar at different point depending on if there is a banner. I used enqueue script in my child functions file and then a custom.js file with my ...
0
votes
1answer
14 views

Automatic add space if user enters number(any digit)

I have one input field in that I need to check that if user enters any digit then it automatic add spaces i.e. When someone enter a phone number like 0499287909 then in string should change the ...
1
vote
3answers
1k views

Load plugin JS in footer

I am trying to load JS files in my theme's to footer.All my custom JS files are being added to WordPress using wp_enqueue_script, but i am unable to find any way which will help me to load them in ...
3
votes
1answer
490 views

WP3.5 Media Uploader - how to make it accept multiple images?

I'm wondering how to make WP3.5 media uploader return 2 or more items in attachement? It always runs once even if 2 items are selected. The code: $('.button').on('click', function(){ var ...
0
votes
1answer
1k views

How to use WP switchEditors.switchto(this) JS function in your own script?

I have a tab switching theme that lets the user choose 3 editing modes when adding new pages (HTML and Visual- these are WP defaults and the new Syntax mode using Code Mirror). I have issues when ...
-1
votes
3answers
2k views

Admin panel: Javascript not loading properly. Cannot edit pages/posts [closed]

I am using the latest Wordpress.org install. None of my back-end javascript is working, none of my navigation drop downs, admin panel areas are not loading as well. I have not edited any core files. ...
-3
votes
1answer
27 views

How to hide a script ( an ad) from a specific post? [closed]

I would like to hide a script, an ad actually from a specific post. The script is placed on header. I am a rookie here so please help!
0
votes
1answer
2k views

How to make Isotope and Wordpress work together?

I am trying to make my Wordpress theme using Isotope plugin. http://isotope.metafizzy.co/ So far, I have such a result after doing that was suggested: I believe that Isotope Masonry should not ...
1
vote
2answers
1k views

Is there a way to enable Cross-Origin Resource Sharing for WordPress' ajaxurl?

WordPress already has a default URL for jQuery-WordPress application calls and it's well known as the ajaxurl. However, there are cases wherein one would need to enable Cross-Origin Resource Sharing (...
2
votes
1answer
1k views

White text on white background in TinyMCE when wp_editor is called in WP 3.9

One of the features of my plugin is to add a TinyMCE editor instance inside a meta box on the Edit Post screen. This has worked great up until 3.9 and I'm not clear as to what's going wrong. Here are ...
0
votes
1answer
10 views

Custom Media Meta fields to alter the generated image HTML that is inserted into a post for my animated GIF image player?

I want to add the capability to integrate a JavaScript animated GIF image player. It basically will load a cover image for the animated GIF on page load instead of downloading the larger animated ...
2
votes
2answers
41 views

Page Reloads Before AJAX Request Finishes

I am working on a WP plugin, and I need to be able to call a URL (specifically an AJAX function) using a button click, but the page refreshes after clicking it, which I think is preventing the AJAX ...
0
votes
1answer
3k views

Parse wordpress blog data using json api and ajax

I have seen lots of responses to how to extract data from wordpress blog posts using the json api plugin. Many uses $.getJSON, $.ajax, .responseData.feed.entries, success function() etc. What is the ...
5
votes
4answers
11k views

theme path in javascript file

I need to include the path to my theme file within a javascript file. How would I go about this? I have already tried: var templateUrl = "<?php get_stylesheet_directory_uri(); ?>"; function ...
0
votes
2answers
1k views

Unable to load “wpColorPicker” on theme customize page

Whether I'm using a Wordpress default theme or a custom one, I see the JS error: Uncaught TypeError: Object [object Object] has no method 'wpColorPicker' when I click "Customize" on the theme. I've ...
-1
votes
3answers
88 views

Enqueue scripts based on browser width?

Is it possible to load scripts through wp_enqueue_script based on a browser's width? Thanks
2
votes
1answer
36 views

How do I change number of columns in a proper way in twentyfourteen child theme?

I'm trying to deactive and reactive a javascript in my childtheme - from the twentyfourteen theme (so updates won't effect things). What I really want to do is to change column width from 4 to 3 in ...
14
votes
5answers
10k views

Validating Custom Meta Box Values & Required Fields

Something which I have never seen covered is the best way to validate that specific form fields are filled out correctly for custom post type meta boxes. I am looking to get expert opinions on how ...
0
votes
0answers
9 views

Pulling in post ID into Live Edit functionality

Pulling in post ID into Live Edit functionality I've got a social media site built off BuddyPress, where we've built custom post functionality off ACF fields, and I need to tie in front-end editing ...
0
votes
2answers
476 views

How to make featured image thumbnails on index page load smoother?

I'm using a theme called Hatch Pro, which is a gallery based theme and the index page displays the posts using the featured image. You can see it here. On slower browser environments, the images ...
0
votes
3answers
492 views

Import HTML code that loads css and javascript into specific page

How can I add the following HTML code into one of my web pages? It's a web form that relies on css and a few java script. Below is the raw HTML code. <head> <link href="css/style.css" ...
1
vote
1answer
49 views

Integrate OpenStreetMap on WordPress

I want to put a map (using OpenStreetMap and OpenLayers) on a WordPress page. I don't want to use a plugin, because I have some specific operations I want to do with the map, and thus I want to stay ...
-1
votes
1answer
1k views

Replacing &#038; in JS code on pages

I am needing to remove the &#038; that seems to be replacing my & on my page code. My original code looked like this: $.get("../form/master.php?called=CAP&captcha="+$("#captcha_txt").val(...
-7
votes
1answer
46 views

show hide image script after 4 seconds [closed]

On my homepage I need a javascript/jQuery script to show our site logo image and close it after 5 seconds. Only when user visits the first time our site. No mouseover or clicks needed. Complete ...
0
votes
1answer
34 views

Getting a variable inside foreach from PHP to JS after localization

I believe I have properly enqueue'ed and localized my script - I've got $q showing up in the DOM. Now I'm sure I'm missing the simple last step to accessing a variable in the JS function. Here's my ...
-1
votes
1answer
217 views

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

Is it possible to create new products in woocommerce using its API with javascript from clientside? I tried this for getting all products: endpoint: https://localhost/wpShop/wc-api/v2/products?...
0
votes
1answer
726 views

Load php function with AJAX on modal window

On a movie information wordpress theme i am developing, i have an href with text "watch trailer" on each cover of all movies. This brings a modal window, and that is working already, but i want to ...
1
vote
1answer
477 views

How to disable specific plugin in mobile version?

I am using wp-cufon plugin , to enable cufon on my site . But I do not want cufon in mobile version . If there is any way to disable that plugin in mobile version or in just disable specific java ...
1
vote
1answer
23 views

How to handle malformed response from WP REST API?

Happy day scenario: I implement WP REST API that sends JSONs to a JavaScript client, which parses it and displays the data to the user. All is fine. What actually happens, inevitably: some WordPress ...