A client side scripting language useful for making interactive web sites

learn more… | top users | synonyms

3
votes
2answers
2k views

Most efficient way to add javascript file to specific post and/or pages?

I am wondering what the most efficient method is to add a javascript file specifically for a post and/or page. Here are a few solutions I came up with: Switch to HTML editing view and post your ...
0
votes
1answer
229 views

Problem passing id-specific objects to javascript via wp_localize_script

I'm using wp_localize_script to pass multiple arrays of data into a javascript file. To differentiate between the different arrays (and prevent overwriting), they are labelled relative to the post id ...
0
votes
1answer
27 views

Will this js code work in a page template?

I have been given this code that I want to adapt and use to change a link in a template.php file, I have not been able to adapt it to work so would love any help that can be given. <script ...
0
votes
0answers
34 views

Page template dynamic links based on browser size

I have a page template that links though to another php file to define what is displayed. The code for the page is - <?php /* Template Name: Portfolio */ ?> <?php get_header(); ?> ...
0
votes
0answers
86 views

javascript errors on mobile browser, not on desktop

I'm building an application based on the wordpress backend. The app is working correctly on desktop, but on my ipad I noticed the javascript broke. I made some investigations and I discovered that ...
0
votes
0answers
34 views

How can I apply a Javascript to the results of a jQuery .load

I'm working on a new plugin that provides shortcodes specifically for ShoutIRC users in Wordpress. This is done by running PHP queries and pulling the results via jQuery.load I'm a long long way off ...
0
votes
2answers
336 views

wp_enqueue_script not working?

Excuse me, I'm very new to PHP and WordPress, but I'm trying to link to an exterenal js file called trans.js, that relies on jQuery. Here is the code at the beginning of the header.php: <script ...
-1
votes
2answers
367 views

Why isn't wp_enqueue_script('jquery-masonry') working?

I'm trying to add masonry sript to my site, but wp_enqueue_script('jquery-masonry'); is not adding the script. Instead I have to use: wp_register_script('jquery_masonry', includes_url(). ...
0
votes
1answer
130 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 ...
2
votes
1answer
304 views

Ajax template: how to handle head section

I know it's easy stuff, but I'm new to this and I can't understand which is the best approach. Background The template I'm working on is a dual theme Desktop/Mobile, UA Sniffing based. Now I just ...
0
votes
2answers
2k views

Load page HTML content through AJAX

I'm currently building a single page style site that loads all content through AJAX, but will degrade back to a standard page load if javascript isn't present. I have done AJAX loading in the past ...
0
votes
1answer
245 views

Load content dynamically & resize event

On complex layouts, heavy use of Media Queries affect performances since the mobile browser still loads all elements that has been hidden. For what I understand now, to load the right layout/content ...
0
votes
2answers
823 views

How to prevent wordpress from loading old versions of jquery in wp_head();?

I noticed my twenty twelve theme is including outdated versions of jquery and js so I want to replace the scripts with the newer versions, however the scripts are in the file included by wp_head() ...
0
votes
0answers
58 views

How do I get jQuery working on the current instance of some repeatable metaboxes?

I hope I can be able to explain my issue. I have a select element that is part of some repeatable metaboxes. I use the select element to show/hide metaboxes. It works fine as long I don't ...
0
votes
1answer
161 views

Why won't the Comprehensive Google Map Plugin load?

all. I could use some help troubleshooting a plugin, since the plugin's author hasn't responding to support threads on the plugin page. I'm using the Comprehensive Google Map Plugin to display a map ...
0
votes
0answers
33 views

Default RTE editor in popup dialogs through templating system?

Setup: The content type add/edit page (content type == post, page or other custom type). A Handlebars template wich is PHP include()ed in the content type add/edit page, which contains a call to ...
0
votes
0answers
188 views

Plugin - including external javascript calling google maps

I have developed a javascript plugin retrieving data for my website (no wordpress here). The user can simply add it to its website with a div (the container of the plugin) and a script tag (the ...
0
votes
1answer
29 views

Can't attach Javascript to theme

I'm currently learning theme development, and tweaking the twentytwelve theme. I've got an external javascript file I'm trying to link, but it won't seem to register. The codex tells me: <script ...
0
votes
0answers
67 views

Wordpress Twenty Twelve Theme: Wrapping post dates in javascript

I'm looking to hide the dates of my posts from search engines (as my content ages very slowly). When it comes to wrapping dates in javascript, I had some success in the past with a theme that used a ...
0
votes
1answer
27 views

How to add Wordpress JS Script Links

Hi I do have a code here from my HTML. I just dont know/forgot on how to link scripts in wordpress... <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> ...
1
vote
1answer
380 views

retrieve custom image sizes from media uploader javascript object

I am attempting to get the custom image sizes that I've created using add_image_size to return in the javascript object. I know how to include them in the dropdown, but I don't want / need that. The ...
0
votes
2answers
60 views

how to make my website secured

i have a php code inside my website to a quotation form that has java script for making name , telephone number and email rquired fields before submiting the form and its working fine but a few ...
1
vote
2answers
3k views

What's the best plugin for allowing javascript in a post or page?

Just looking for a recommendation on the best plugin to allow javascript in a post or page.
1
vote
0answers
132 views

Fancybox type popup window that's not an iframe

I'm a bit stuck and need some help to get me going in the right direction. I'm trying to do something similar to the lightbox style popup on this website: http://cargocollective.com/montessori I ...
2
votes
3answers
2k views

Comment Reply javascript

I am working on a client site which is a very stripped down theme. It has no standard html markups as a result of which the reply box doesn't move upto the place of being just below the comment to ...
0
votes
1answer
42 views

Dealing with a library that depends on jQuery

I am about to use the pikachoose.com library with wordpress. However, this library references jQuery, and uses the short form (using $). In WordPress documentation, it states that the short form ...
0
votes
1answer
55 views

JavaScript Libraries in WordPress

I understand that in order to use a JavaScript library in WordPress, such as jQuery, we have to use the following code to prevent conflicts: function my_scripts_method() { wp_enqueue_script( ...
0
votes
1answer
236 views

in jquery read a multidimensional array via wp_localize_script()

From PHP I am pushing a basic array to jQuery via wp_localize_script() and then using the array data in my script file. Now I have extended the array into a multidimensional array and can not figure ...
0
votes
1answer
162 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
2answers
170 views

creating a static HTML/JS/PHP page

i need to create a static page that allows me to code HTML/JS/PHP that connects to a separate MYSQL backend. how can i achieve such in wordpress page?
0
votes
0answers
89 views

Advice on loading iframes in a custom post class

So I wrote this custom post type that works as it should. The post type consist of a table of titles, when the heading is clicked a twitter bootstrap modal is loaded. Now I realized that I need to add ...
1
vote
2answers
317 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
167 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
0answers
97 views

BuddyPress AJAX doesn't work despite buddypress.js enqueued and ajax calls being made

I have BuddyPress 1.8 and WordPress 3.5.2, along with bbPress and many other plugins Since BuddyPress switched to a new template handling system from 1.7, there was no longer need for BuddyPress ...
0
votes
1answer
206 views

JS this.href not getting link from menu item

I have a script to fade in and out the page container when a link is clicked in the nav. I have attached the script to the .menu-item class to target just wordpress menu links. The script itself seems ...
3
votes
1answer
94 views

How to intercept already localized scripts

If a plugin uses some script (prominent example: jQuery UI Datepicker), but you're not happy with how the script renders the output, then there're two possibilities: 1. Unregister the script > Add ...
-2
votes
1answer
78 views

Use Wordpress Built In Jquery

I see that on every page Wordpress is loading in jquery, how do I go about using that jquery as it keeps telling me that it doesn't recognize $ or $noConflict(); - I'm trying to add some jquery under ...
0
votes
0answers
38 views

Display post name on homepage

On this website I'm currently developing, I've got a post changer on the homepage (example: songhype.com), what basically happens is Wordpress checks the category for posts, pulls in the post using ...
1
vote
2answers
195 views

How to load javascript file on homepage in Wordpress in order?

I am using a quicktags plugin, which was not loading on the home page, now it does, but it does it on the wrong place. How can I solve this? I want the quicktags.min.js file to load first, rather ...
0
votes
0answers
547 views

Add jQuery Validation in Gravity Forms Form

So I have some jQuery functions that adjust my column layout on window load and window resize. They are inside a file called bp-columns.js that looks like this: jQuery(window).load(function () { ...
1
vote
1answer
36 views

a child theme not de-registering a patent javascript file

We're currently rolling out a number (>100) of wordpress sites where we're using a custom child theme and a holding page plugin. Most of our clients use IE8 as their browser (corporate policy) and ...
1
vote
3answers
334 views

How do I sanitize a javascript text?

I have a textarea that will receive a js snippet(Google Analytics). Is there a way to sanitize that? Since I cannot use functions like wp_filter_nohtml_kse(), what should I use?
0
votes
1answer
56 views

Showing Different Code on Pages With Different Layouts

I have pages and posts on a WordPress site. The pages have various layouts. Parent pages are following a 2-column (maincontent + right sidebar) layout while child pages have a one-column layout (no ...
0
votes
0answers
31 views

cookies creating bugs and interfering with js and correct images and css display when login in the back office

i have experienced weird behaviours with custom js functions output as well as contact form correct display. I have localised a problem being , everytime i connect to admin , i need then to clear ...
2
votes
1answer
64 views

3.5 media.editor: what is the event listener for choosing an image?

What is the event listener for selecting an image in the media.editor javascript. I am attempting to add a multiple image selector to a custom plugin, and I need to show the user what images they have ...
0
votes
0answers
38 views

3.5.x Theme Customize: Handling Custom Control Requests

I am extending the WP_Customize_Image_Control as a means to include an upload-able word mark for a site. The control works just fine, but I need to do some post process handling on the image (i.e. ...
0
votes
1answer
248 views

Creating a custom wordpress widget and stopping js from running twice(once in active widget once in widget selector)?

Ok so here's the question how do i stop js from running twice on the widget.php page? I am creating a ajax loaded custom image selector from a domain on the same server as the current site. I want ...
6
votes
2answers
2k views

How to configure Wordpress to be able to use <script> tag inside posts?

I'm looking for a solution that would allow me to write tags inside posts and be sure that the visual editor or wordpress will not alter them. The same problem can apply for other specific HTML code ...
0
votes
1answer
115 views

Localizing methods for jQuery append prepend wrap parent

So I am serializing some options in WordPress and then localizing them to be used in my jQuery script, however what I am trying to do next isn't working. jQuery('.advert')+ lu_ban_object.method ...
0
votes
0answers
126 views

Replace Short code in Visual Mode - WYSIWYG editor

I write a code in functions.php to make shortcode [template_url] and [site_url] in WYSIWYG editor. Its works fine for front end. add_shortcode('template_url', 'replace_shortcode_template_url'); ...