A client side scripting language useful for making interactive web sites

learn more… | top users | synonyms

0
votes
1answer
370 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
1answer
18 views

Is it possible to pass js variable to template file

I have select drop down created in functions.php and in js file getting onchange value of drop down. I want to know do I pass this variable to my template file?? This is my code in functions.php file ...
2
votes
1answer
419 views

Wordpress Ajax Login without page reload

I'm currently developing a Wordpress theme where I want the user to be able to upload images before he register or log in to the site. The initial problem was, you can´t upload images to wordpress ...
0
votes
1answer
279 views

Resolving Javascript errors likely related to Gantry framework

I'm trying to resolve some Javascript errors on a site I'm working on (built using the Gantry framework), as I have a sneaking suspicion they're keeping some plugins from working properly. For ...
0
votes
1answer
525 views

Replacing & in JS code on pages

I am needing to remove the & that seems to be replacing my & on my page code. My original code looked like this: ...
0
votes
1answer
38 views

How to call plugin path in JS?

I am using wp-store-locator plugin and I want to add plugin directory path to my JS. html = "<li data-store-id='" + id + "'><div><p>" + storeImg + "<strong>" + store + ...
-1
votes
3answers
581 views

Pass a PHP variable (loop-audio.php) to jQuery function (js/script.js)

I've searched a lot for this and I seem to get different answers. In my situation, my jQuery function has to use a PHP variable from a different file. How can I accomplish this? Clear and simple ...
0
votes
0answers
15 views

Getting WordPress to recognize ActionScript [closed]

I have a flash video that I have embedded on my page using SWFObject. From reading around I discovered that in order for the flash video to be controlled via Javascript I need to enable ...
0
votes
2answers
411 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 ...
0
votes
0answers
20 views

How can I correctly POST to a Wordpress page?

I'm creating a timetable page for a community-run bus route planner/timetable site, and I'm currently coding a page where the user can select their desired bus from a drop-down list, and then PHP will ...
0
votes
1answer
2k 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 ...
0
votes
1answer
402 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 ...
0
votes
1answer
291 views

Javascript/jquery loads super slow (around 6 seconds) which affects only homepage

I got a custom wordpress theme from a developer but he isn't responding to me anymore. Basically my homepage takes ages to load which causes all the elements on the homepage not function until the ...
0
votes
1answer
254 views

Linking Javascript in functions.php file

Below is my raw javascript embeds from my html template. But I cannnot figure out exactly how to add it to my functions.php file. It seems pretty difficult. Can you please assist with the correct ...
1
vote
1answer
18 views

Any required callbacks to WP.com or WP.org?

China is blocking both WP.com and WP.org. I would like to know if WP4.0 includes any callbacks or references to files such as javascript libraries located on these domains, because I must plan for ...
0
votes
0answers
72 views

Front-end ajax login form broken after WP4.0 upgrade

A site I manage has a a simple form a user can click on to login using ajax. It worked great until I upgraded to wordpress 4.0 Here is the relevant code: Function.php: function ...
0
votes
0answers
6 views

Search box for hierarchical taxonomies in admin interface

When hierarchical taxonomies (like categories) have lots of terms it gets difficult selecting them in the admin interface. A UI solution would be a search-box (like non-hierarchical taxonomies / tags ...
4
votes
3answers
188 views

How to echo JS right after enqueued script to put it into noConflict mode?

I want to include and use third party JavaScript file (Bootstrap Tooltip) in my plugin. Since Bootstrap is highly popular framework and tooltip() is rather generic name I want to make use of included ...
0
votes
1answer
27 views

How does WP determine the difference between a post and a page url

I'm trying to mimic WP routing in a javascript plugin. I've successfully imported the rewrite rules and am applying them to the browser location. But I can't seem to parse the difference between a ...
15
votes
4answers
2k views

Could the WP script/style loader be used to concatenate and gzip scripts and styles in the front-end?

WP has a nice javascript loader included in wp-admin: http://core.trac.wordpress.org/browser/tags/3.0.4/wp-admin/load-scripts.php and a CSS loader: ...
2
votes
0answers
55 views

What are the effects on loading times when conditionally loading and concatenating scripts? [migrated]

Suppose you have a script in your theme that you always need on every page - say 'animate-menu.js' (10KB) - and you have one that you only need on one specific page - say 'validate-contactform.js' ...
0
votes
0answers
19 views

Nothing happens when trying to add value into taxonomy

When trying to add a value into any taxonomy (custom or default), nothing happens when the user clicks 'Add' (see http://i.imgur.com/Um1JsoD.png). My suspicion was that there may have been a js ...
0
votes
1answer
670 views

Replace link with form to pass variables to javascript / ajax

I'm sending a single variable to javascript/ajax via a link, but want to send via a form so I can pass user input as well. (It's for a plugin that interfaces with an Echonest Remix python script to ...
0
votes
1answer
220 views

loading a javascript on a WP PAGE

so im trying to do this http://jsfiddle.net/2XV7w/5/ on my custom_page on wordpress. this is a conditional html form. It will display a specific <div> when i choose a specific drop-down value. ...
0
votes
3answers
291 views

How do I add some javascript validation to the admin interface form's onsubmit?

I have a plugin that adds meta boxes to the admin interface and I need to do some validation when the user presses the "update" button before the form is submitted. Is there a WordPress action or ...
3
votes
1answer
454 views

Menu Link Redirect Based on Username or User ID

I am building a client portal where my clients can log in and see all their pending projects, completed projects and create new projects. Though I'm stuck at the start. The dropdown menu is called ...
1
vote
1answer
310 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 . ...
1
vote
2answers
287 views

Elegantly using JavaScript on widget admin forms

I'm working on a project involving a lot of widgets, and I'm thinking it'd be really great to have a "More options" section built using jQuery UI Accordion that expands when clicked. So, I've ...
1
vote
1answer
682 views

Placing Ads after every 10th Post with Infinite Scroll

I have to load a couple of ads, some normal html and two are java script. I've tried the PHP method of this: <?php $postnum++; if($postnum%10 == 0) { ?> <div id="topset"> <ul ...
0
votes
1answer
1k 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 ...
4
votes
3answers
213 views

Combine enqueue js without affecting dependencies

I want to combine little javascript files while keeping other script's dependencies for them. Is there any way? Details: New version of BuddyPress enqueue 6-7 little javascripts: // Legacy ...
1
vote
1answer
42 views

Using shipped version of jquery

Thare are no errors in the JS console. My goal is to use the shipped version of jQuery that Wordpress uses to work with bxslider. According the link shown here, the current version of jquery shipped ...
2
votes
1answer
241 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
521 views

Meta slider plugin only works after first refresh - Object has no method 'flex slider'

I have a wordpress theme I am using called 'Nordic', however I did not like their slider plugin, so I used my own... '[Metaslider][1]' The problem is when you first load the page, the slider does not ...
1
vote
1answer
47 views

Adding javascript actions to words in post content

I would like to have my blog run some JavaScript code when certain particular words are clicked on. One approach would be to include "onClick" handlers in HTML elements within the posts and disable ...
1
vote
0answers
17 views

esc_js() breaks unicode sequences by removing the slash '\' character

I've noticed that esc_js() is breaking unicode encoded characters by removing the '\' (slash) character. For example: esc_js('\u041f') returns: 'u041f' I can potentially use REGEX to identify ...
0
votes
1answer
308 views

Custom attributes to javascript tags

My site uses cloudflare but I really want to enable rocket loader, but if I put it on automatic mode, it messes up my whole site... So I googled and found This answer which has helped in terms of ...
0
votes
1answer
495 views

TypeError: window.tinyMCE.execInstanceCommand is not a function

I can't add any shortcode in my wordpress editor. it shows - TypeError: window.tinyMCE.execInstanceCommand is not a function window.tinyMCE.execInstanceCommand(id, 'mceInsertContent', false, ...
0
votes
1answer
41 views

How to get DEFER or ASYNC attribute to appear when I add a stylesheet with wp_enqueue_style from a plugin? [duplicate]

Almost all of my CSS and JS resources can be postponed with an ASYNC or DEFER tag added to the resource. This may improve performance of my page load times considerably. However, I don't know how to ...
0
votes
1answer
24 views

How to deregister scripts all at once

How can I deregister all wordpress scripts all at once except for the admin? I have looked at the discussion How can I de-register ALL styles all at once? And same with Javascript?, but i do not want ...
0
votes
0answers
29 views

add bootstrap modal after login in wordpress

I'm trying to add a boostrap modal just after login in my website. I have my javascript: jQuery(document).ready(function($){ $('#after_login_modal').modal(); }); I have my div: <div ...
1
vote
1answer
27 views

How to get my plug-in, wrote in php, to refresh on its own every 5 minutes?

I wrote a plugin with custom widgets for the Dashboard. It retrieves information from an XML file, and display the information into the widget. The XML file will be modified a bit every few minutes or ...
3
votes
1answer
135 views

How to add a “data-” attribute to the image tag of native gallery output

While trying to make WordPress and Galleria to become friends I already have a good result. Galleria can easily be used to display native WordPress Galleries. I'm using a plugin but that's not ...
-3
votes
1answer
45 views

How to Javascript/jQuery

I am trying to turn an HTML 5 template into a Wordpress theme. The jQuery/Javascript combo seems not to be working, what should I do? (I just used <?php echo get_template_directory_uri(); ...
0
votes
0answers
11 views

How to modify a class in load-scripts.js ?

I need to semplify the image edit interface and I need to override a couple of function defined in load-scripts.js in the class imageEdit. There is a way to override it? And there is an unminified ...
1
vote
1answer
46 views

Heartbeat API: How to access data already enqueued?

I'm having problems when trying to access data that I've queued using the Heartbeat API. I'm queuing data using wp.heartbeat.enqueue(). For example: var data = { my_key: 'value' }; ...
0
votes
2answers
96 views

Filter custom post types by custom field using AJAX

I have a few custom post types (books, films etc) created with WP-Types. I then have a custom field called Genre, created with ACF. If a user selects "Books" from the dropdown on the frontpage, he ...
0
votes
1answer
196 views

How to add external remote JS source to Gravity Forms?

I would like to add an external javascript source to my Gravity Form. Like this: <script type="text/javascript" ...
0
votes
1answer
22 views

Need to hide an element depending on date and post category

I've been racking my brains for a few days trying to figure this out. I'm using WP Voting on my site. I need to create a script in single.php that will remove the div that contains the voting widget ...
0
votes
1answer
44 views

Show Post Content with AJAX

I want to do a very basic AJAX call where, on click of a list item, a container div fills with associated content pulled from a Wordpress page. I'm a newb with AJAX; I've tried a few different routes ...