Tagged Questions

A client side scripting language useful for making interactive web sites

learn more… | top users | synonyms

0
votes
1answer
15 views

Javascript gets removed from header.php [on hold]

Wordpress 4.0.1 & Discover theme I'm trying to add javascript code at the beginning of in my template's header.php for a single page (code from Google Analytics Experiment). First way didn't ...
-3
votes
0answers
15 views

Add on for plugin written completely in javascript

I'm writing a plugin with Backbone.js. I plan to distribute it under freemium model. But how'll I build addons for it? Because the only PHP code I have is the AJAX handlers.
1
vote
2answers
42 views

Can't get a JSON object in response to an ajax request with wp_ajax

I have a problem with WordPress and ajax. This is my javascript part (I trimmed it a bit): var posts = $.ajax({ type: 'POST', url: ajaxurl, async: false, dataType: 'json', data: ...
0
votes
1answer
29 views

displaying an onclick overlay [closed]

I'm wanting to add a onclick overlay to my wordpress site located at A1cleaningservicesnw An example of this I have found is located here. when you click on one of the portfolio images it loads up an ...
0
votes
1answer
13 views

What would prevent my plugins from loading when forcing my posts to appear in a scaled-down fancybox.js iframe? [on hold]

What would prevent my plugins from loading when forcing my posts to appear in a scaled-down fancybox.js iframe? In a normal single.php post page, my ratingwidget and GAP (GIF Animation Player) ...
0
votes
0answers
22 views

admin-head-{$page-name} [duplicate]

I wish to load a small jQuery script in the admin page of a custom post. Initially I used the admin_head hook, but from what I've read, this seems to load this script globally across all admin pages? ...
0
votes
0answers
7 views

Encoded email address fails

For years I've used encoded (example http://hivelogic.com/enkoder/) email addresses in my posts and pages. Recently I've found that the current version of WP no longer handles long addresses (example ...
0
votes
1answer
24 views

Wordpress Javascript Widget jQuery Dependency Issue

I am using a local clean install of WP 4.0 en_GB with no plugins. I have been provided with some information to implement a JS widget into my website. <div id="login"></div> <script ...
0
votes
0answers
24 views

Passing JavaScript variable to PHP popup

I have a popup that has a list of people. The user is allowed to select up to 3 people that they would like to compare. I then would like to show them a page that's comparing the 3 people that they ...
0
votes
0answers
15 views

Combine and minify plug-in JavaScript

I am optimizing a themeforest theme that uses several plug-ins that are required and I am actually using, however, to improve page speed I want to combine those files and minify them. I've seen some ...
0
votes
1answer
24 views

JQuery Plugins in Wordpress

I have been able to somewhat piece together how this should be done but I am really struggling with it. I want to use the Table Sorter plugin (http://tablesorter.com) in a custom Page Template to ...
0
votes
1answer
13 views

In post.php how can I remove onbeforeunload?

I am trying to remove the onbeforeunload on post.php but none of the solution I have found online work. I tried: (function() {window.onbeforeunload null;})(); I am using the action: admin_footer ...
1
vote
0answers
81 views

How to resize image on client-side before upload?

I've been using Plupload to resize images on the client side before uploading them to the server. I've implemented a front-end form which lets the user select a file from their computer and submit it. ...
-1
votes
1answer
97 views

W3 Total Cache: Load CSS asynchronously for better PageSpeed score? [closed]

I'm using W3 Total Cache to minify about 15 CSS files, and also to minify 20 JS files and load those asynchronously in the footer. Running my site through PageSpeed gives me the following message: ...
0
votes
1answer
38 views

Add javascript to a woocommerce page template

I have the following code in my functions.php add_action( 'wp_enqueue_scripts', 'dc_datepicker_options' ); function dc_datepicker_options() { if ( is_page_template( 'single-product.php' ) ) { ...
0
votes
0answers
13 views

Getting lightbox to load javascript on custom theme

I have a site where I want to embed videos in a lightbox. I'm using WP Video Lightbox plugin for this, but instead of the video popping up in a lightbox, it just acts as a link to youtube. Here's a ...
1
vote
1answer
80 views

Change in permalink structure made javascript cookie not work correctly

My site needs a mechanism where a user is sent to agreement page when he visits the site for the first time. Once he accepts the agreement, it is saved in cookie. He can browse any page directly after ...
0
votes
0answers
30 views

how to load post content when a post title is hovered using ajax

i have a wordpress blog and i need to make my posts content show up when vistor hover the title of the post on my index page with no need to get into that post , exactlly like in the following site : ...
6
votes
4answers
725 views

Is there a JavaScript API? How to access public and private data in JS?

According to this post there is no built-in JavaScript API for Wordpress. Therefore developers who want to build on AJAX seem to come up all with their own solution which doesn't seem right to me. ...
0
votes
0answers
20 views

Op-tin bar hide sticky header when scrolling the page

As you can see in this link http://marketingilluminated.com/ At the top the op-tin bar hides the sticky header when you scroll in the page. I would like to know if there's a solution to keep them ...
0
votes
1answer
29 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 ...
0
votes
1answer
48 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 + ...
0
votes
0answers
22 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 ...
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
14 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 ...
0
votes
1answer
31 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 ...
0
votes
0answers
21 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 ...
1
vote
1answer
55 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 ...
1
vote
0answers
23 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 ...
1
vote
1answer
50 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 ...
4
votes
3answers
231 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 ...
0
votes
1answer
80 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
29 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
45 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 ...
0
votes
0answers
81 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 ...
-3
votes
1answer
48 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(); ...
1
vote
1answer
28 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 ...
0
votes
0answers
12 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
54 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
210 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
24 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
69 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 ...
0
votes
1answer
55 views

WordPress opens js files as a catalog. Path is right [closed]

When I import external js file everything is okay.. no matter if I import it by <script> tag or by wp_register_script function but when i try to import local file everything crashes. Firstly I ...
-3
votes
1answer
54 views

dropdown does not work [closed]

I have the page http://www.supersprox.eu/invoicewithtabs/. When I click "Show filter" button an area with several dropdowns appear. The problem is I can not select values of the first row of ...
0
votes
0answers
28 views

Is server side Javascript possible with wordpress

Is it possible to run JavaScript server side on wordpress. I have about 5,000 lines of Javascript that I would like to run on the server, rather than the client (browser). 5,000 lines is a lot of ...
0
votes
1answer
120 views

Accessing an API with jQuery and AJAX

As a proof of concept I'm trying to access an API using jQuery and AJAX and posting the results to a page. After following some online tutorials and doing my best to put it all together, I have the ...
3
votes
1answer
186 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 ...
0
votes
1answer
139 views

admin-ajax.php (aborted) error when using jQuery.get

One thing that really confuse me is the following: When I load a javascript file via Ajax and I watch the http requests thats being made, then I see the following error in Firebug: admin-ajax.php ...
1
vote
4answers
127 views

jquery won't load in footer

I wanted to move jquery to the site's footer, but that doesn't work. I've tried it with the following code. As you can see, I have a couple of another scripts and they load correctly on the footer. ...
0
votes
0answers
15 views

Enqueue script in Widget

I am trying to use wp_enqueue_script inside function widget of the Widget class. But it seems like when I print html it doesn't handle the javascript functions which I enqueue before. This enqueue ...