A client side scripting language useful for making interactive web sites
0
votes
0answers
53 views
wp_enqueue_scripts Script dependency Catch 22? [closed]
I have a function in my functions.php that calls my custom tracking JavaScript file. It relies on Piwik's JavaScript to be loaded beforehand or else I get this error:
Uncaught ReferenceError: ...
1
vote
2answers
596 views
Custom Scripts per page or Custom Post Type
A client has requested some interesting functionality. THey have about 20 different scripts, most of which are needed by one page only. They would like an area within Wordpress's pages and custom post ...
0
votes
1answer
407 views
Want to add comments to NextGEN Gallery
Does anyone know how to do it?
I would like to implement Facebook or Disqus comments.
I am using the gallery with the shutter effect.
Thanks for your help!
2
votes
1answer
86 views
How to localized one js file for different actions?
I have a group of javascript functions in one js file. each function acts on a specific action and get its own ajax response. some are on different pages, some are on the same page. If I don't do the ...
-3
votes
1answer
320 views
Google AdSense Ad not showing up in WordPress Blog [closed]
I cannot get a Google AdSense ad to show up in a WordPress blog I'm working on. The ads have been approved and I entered the code (and double-checked the code to make sure I had it right). The code is ...
0
votes
1answer
169 views
if is_home(), change class of menu-item-225 of wp_nav_menu
Thanks for taking the time to check this out. I know it's outdated, but I'm using Wordpress 3.2.1.
I have a Custom Home Page - where I created a Page for it and titled it as my Home Page with the ...
0
votes
1answer
467 views
Using the loop to set locations for all posts on a single google map
Firstly, hi all! I am new to worpress stackexchange.
I have been trying to build my own google map to show the location of all my posts. But I don't seem to be able to get the markers to display on ...
1
vote
1answer
256 views
Javascript stopped working [closed]
For some reason, the scripts that I have set up on my wordpress install stopped working yesterday afternoon. I had been editing things, but I'm not sure what I could have done that caused it to stop.
...
4
votes
1answer
419 views
Automatically decrease font size for long words
I am working on an e-commerce site in which post and product titles will need to be displayed in fairly narrow divs. I would like to set a specific font size for words which can naturally fit in the ...
3
votes
4answers
102 views
How do I make my wordpress page more friendly for mobile viewers?
My basic question is How do I make my wordpress page more friendly for mobile viewers?
I have seen some answers such as wptouch, wordpress mobile pack, and mobilepress http ...
1
vote
1answer
539 views
force enqueue script to be first in order of prominence
I have a few scripts which are being enqueued,
the problem is that I want to force the order of prominece to which these scripts are loaded. There is one in particular which is loaded from a plugin ...
5
votes
1answer
1k views
Register and enqueue conditional (browser-specific) javascript files?
The WP.SE community has always advised the use of wp_register_script and wp_enqueue_script for adding scripts in a theme/template (and likewise, wp_register_style and wp_enqueue_style for ...
2
votes
2answers
327 views
Has anyone used require.js for handling plugin scripts?
I'm starting to refactor the code of my plugin and I'm thinking about using require.js to handle the scripts so that i have a codebase which is more modular and testable. And I'm also planning to load ...
4
votes
2answers
3k views
Enable Submit Comment Without Page Reload (Using Ajax)?
When user writes a comment and hits the submit button, WordPress reloads the page, before the comment is shown to the user.
Is there an Ajax-based solution that allows users to submit questions ...
2
votes
3answers
460 views
Set Featured Image programmatically (in admin) with JavaScript?
I'm trying to set the post thumbnail (featured image) with javascript from an existing image in the media gallery. I would consider a php-based option too I suppose (one that would require clicking ...
1
vote
1answer
331 views
How do I get the $handle for all enqueued scripts?
Is there some way to get the $handle for each script that has been enqueued?
Is there some array that holds all the handles so that I can loop through it and do something using each $handle?
0
votes
1answer
91 views
How to convert that page to a wordpress template? [closed]
Couple of days I am trying to integrate THAT page in wordpress. I converted it to wordpress theme but can't make the images to loads. All I see is the loading circle. I changed the path in javascript ...
1
vote
1answer
238 views
Add a class to links in the visual editor (how to get old dialog back)
New:
Old:
In short, i want a list of some classes inside the add link dialog. Because this was default there might be a easy way to get it back like this?
Long:
I like to have the ability to ...
0
votes
2answers
478 views
WordPress Carousel Hover Image
I a using an image carousel to display some pictures on my website. The carousel I am using is called: Jcarousellite (http://www.gmarwaha.com/jquery/jcarousellite/). I have the carousel setup, styled, ...
0
votes
3answers
833 views
Fall Back Google CDN in JavaScript
In HTML5 Boilerplate it Grab Google CDN's jQuery with this JS code
<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->
<script ...
0
votes
2answers
539 views
How can I include JavaScript that use jQuery on admin side
I try this:
add_action('admin_print_scripts', 'custom_admin_scripts' );
function custom_admin_scripts() {
echo '<script type="text/javascript" src="' . get_bloginfo('stylesheet_directory') ...
2
votes
1answer
57 views
What's the handle for media.js?
I want to use wp_enqueue_script to load media.js from frond end. I use Win Grep searching through the whole WP dir, couldn't find which handle this media.js was registered.
in this media.js , there's ...
0
votes
1answer
668 views
How to make wordpress URLS google friendly for ajax driven sites?
Our wordpress site utilizes the wordpress cms to serve up json data that we ingest via ajax requests and serve up with javascript. I would like to create URLs for my regular wordpress pages/posts that ...
0
votes
1answer
145 views
wp_enqueue_script does not recognize my js file?
my wp_enqueue_script does not seem to work, i can't understand why :
i have a child theme of twenty ten,
i wrote this in my functions.php file (in my theme) :
<?php
function my_scripts_method() ...
1
vote
1answer
328 views
Accessing WPDB Multidimensional JSON Array w/ Javascript
I am having trouble accessing json values return from an ajax call.
Here is the call:
$.ajax({
type: 'POST',
data: 'user_id=' + user.user_id + '&user_login='+ user.user_login,
...
1
vote
2answers
522 views
Where and how to put inline js in pages
On the internet there are thousand of articles on how to insert external scripts using wp_enqueue_script().
Anyway i didn't find anything explanatory on how to add inline, <script> enclosed, ...
2
votes
1answer
1k views
How to add javascript just before the closing body tag in the footer of WordPress
I'm following some of the other people's advice here about adding my js file before the closing body tag but it doesn't seem to work for me.
If someone would be so kind as to check this for me ...
2
votes
3answers
1k views
How to handle multiple instance of “send_to_editor” js function
Here is what I am doing:
I Added wordpress media upload with iframe popup when a button or link clicked. And with click of insert into post the image url placed on a textbox.
send_to_editor() ...
2
votes
3answers
436 views
Add javascript when post is published
I am trying to add javascript when a post has been published so that it's more noticable for my user but I can't figure out what to use.
I tryed with publish_post and save_post, but it doesn't work ...
1
vote
1answer
779 views
Add a Fancybox automatically to post type “post” images
Currently, on my homepage (which is a list of posts), if you click an image it opens in the same window as a full size image.
I'd like to change it so that when a user clicks said image it opens into ...
1
vote
1answer
235 views
How to handle shortcodes when using the JSON API
I'm wrangling a little logic problem:
I'm making a single page WP theme which uses the JSON API for the content and Mustache style templates for the presentation... However, shortcodes? What would be ...
2
votes
1answer
810 views
require.js to load javascript
whilst wp_enqueue_script seems to work it's not really elegant. I'm currently making a WP front end which uses MVC (backbone.js) and has literally 30+ seperate Model/View/Collection/Controller scripts ...
0
votes
1answer
680 views
How do I add custom attributes to javascript tags in Wordpress?
I am looking to enable CloudFlare's RocketLoader feature that enables asynchronous loading of Javascript for my Wordpress site. The problem, however, is that there is one plugin for that I want to be ...
1
vote
1answer
127 views
Clean-up script tags
I want to clean up <script> tags generated by WordPress to produce more semantic output for HTML5.
You can already do this for <style> tags using this code attached to the ...
1
vote
1answer
221 views
Adding wp_ajax to a theme outside functions.php (on specific template page)
I'm doing a function which requires the use of the wp_ajax action.
I've followed this guide to set it up with the differences of adding the requesting the object AJAX file in functions.php and also ...
3
votes
1answer
572 views
Check user logged in with JS
I use FaceBook JS SDK to check whether the user has permission to log in to my site or not. If user has permission I log him into the WP site.
It is possible to check with JS whether the user ...
0
votes
1answer
913 views
Rotate 5 testimonials at a time with jQuery [closed]
I am looking to show 5 testimonials at a time, and have simple navigation arrows rotate to the next 5 when clicked. I'm still new to JS and jQuery and am having some trouble figuring this oneout. I ...
0
votes
1answer
43 views
Is it possible to run javascript on plugin deactivated?
Is it possible to run javascript on plugin deactivated and if yes then, how should I achieve that.
I have developing one plugin in which two new tables are created in wp database and on deactivation ...
0
votes
2answers
277 views
How can I integrate yepnope.js with Wordpress (and plugins)?
To improve my website's loading speed a bit (and to impress the judges--sad reality of the kind of website I'm building, there are judges), I want to implement yepnope.js to load the Javascript ...
0
votes
1answer
807 views
Change Query Arguments (filter) with jQuery/Ajax or PHP?
I have a pretty complex wordpress-site for travelling. There's an "archive-hotels.php", a template for the custom-post-type "Hotels". Inside the CPT is a taxonomy called "City", so we can do this: ...
0
votes
1answer
100 views
Removing admin javascript
I'm having some trouble adding jquery-week-calendar to WordPress' admin interface using add_menu_page and other API methods. What I found out is that the default jquery-ui and other JavaScript ...
3
votes
2answers
174 views
What are the benefits of using wp_enqueue_script?
Is there any real benefit to using wp_enqueue_script on small self-managed sites? For instance, Modernizr, why enqueue it through a function rather than call it directly inside the document head?
I ...
0
votes
2answers
69 views
Is it possible to isolate and use Wordpress functions outside of wordpress
I'm seeing a lot of jobs on elance and vWorker for converting html to wordpress? what's the general process for doiing this? hunting and pecking through the codex? what happens when you get to some ...
-1
votes
1answer
1k views
how to include javascript file and css file in wordpress
I am creating new plugin so i need add a java script file and css file.
These are my javascript files
jquery.min.js
jquery-1.3.2.min.js
jquery.tabify.js
Css file:
newstyle.css
-1
votes
1answer
237 views
How to add a hash tag to the menu URLs? [closed]
I currently use AJAX in my theme to load the main content. I want the menu to be highlighted on the current page.
The script I'm using for AJAX puts a "#" in the URL .. (ex: http://localhost/#/bio/)
...
0
votes
2answers
287 views
Is there a way to set the order of wp_footer hooked functions?
I was wondering if we can set the order of a function hooked to wp_footer(), I created a function that echos:
<script> ajsfunction(); </script>
and I also enqueued the js file of this ...
3
votes
1answer
786 views
single page wordpress
I like wordpress as a CMS and I think it's got a lot there with it's vast plugin library however the front end, dare I say it is a bit out of date.
I don't like the system of old going page-to-page ...
0
votes
1answer
231 views
admin_enqueue_scripts not rending JS file correctly
I'll keep this short and sweet, I want to load a JS file in the admin panel as part of my plugin, and through tons of research I have a few different options that have all ended with the same problem ...
1
vote
1answer
118 views
Morris.js for Wordpress?
I found Morris.js to be a delightfully implemented charting script, and wanted to include it in my Wordpress installation. But I have never included a js file with my blog before, and would appreciate ...
1
vote
1answer
65 views
Localiztion in javascript
Wordpress currently uses the gettext feature which is available in php but unfortunately not in Javascript.
I have searched this matter on the web and have come up with this trick. But there is a ...