A client side scripting language useful for making interactive web sites

learn more… | top users | synonyms

0
votes
1answer
24 views

Add Item to Custom TinyMCE Menu

I've created a custom menu which appears on my TinyMCE toolbar but would like to add another item to that menu in a separate function elsewhere in my plugin (depending on whether some other ...
1
vote
2answers
770 views

Defer all js except certain ones in functions.php file

I read How to add defer="defer" tag in plugin javascripts? and the code @toscho posted works good to defer certain js files or deferring ALL js files by commenting out the contact-form-7 ...
0
votes
4answers
46 views

Add JavaScript to single post

I want to add small javascript program in wordpress post, please let me know how to add / execute in WP Post ? EDIT Yes I tried, but no luck. First I added HTML Code & JavaScript in Post Text ...
0
votes
1answer
14 views

Javascript not working

Here is my js code var geoSearch = new google.maps.Geocoder; jQuery(document).ready(function() { var address = FYN_search.postcode; if(jQuery.type( address ) === "string"){ var region ...
1
vote
1answer
511 views

Javascript WP Object Documentation?

I was working on implementing the media library within one of my plugins/themes. I found a nice tutorial (http://mikejolley.com/2012/12/using-the-new-wordpress-3-5-media-uploader-in-plugins/) that ...
0
votes
1answer
414 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 ...
0
votes
1answer
102 views

How to solve 'Eliminate render-blocking JavaScript and CSS in above-the-fold' content for multiple files?

I get this when I check my site in google insight: Pretty ok right? But I still consider to fix Eliminate render-blocking JavaScript and CSS in above-the-fold content to get a good results on ...
0
votes
1answer
20 views

Trouble with Wordpress Ajax Login System - 302

I'm trying to create a simple Ajax Login system with Wordpress. Unfortunately, every time the "wp_signon" function is fired, my system failed and the only information I have is this one : POST ...
0
votes
0answers
23 views

Youtube Iframe Api play one video at a time

Below is my code and only video 1 can stop video 2 but video 2 can not stop video 1. I want one video to play at one time. What could be the reason and i am using shortcode and below is my code in ...
0
votes
0answers
23 views

Wysiwyg editor not working on 4.2.2

I've recently upgraded a site for the Add Media button wasn't working. Now, having upgraded to 4.2.2 the Add Media works, but the Wysiwyg editor isn't showing. The only console messages I'm receiving ...
3
votes
1answer
48 views

Modify Custom Field in Media Library using JavaScript

I've added a custom field into my media attachments: function set_image_data( $form_fields, $post ) { $form_fields['text_color'] = array( 'label' => 'Text Color', 'input' ...
-1
votes
1answer
31 views

Add Javascript/Html into a WordPress

I have done this javascript in order to get email opt-in form when the video ends. What I am looking for now is to bring this code to a wordpress which I am not really familiar with the whole WP codex ...
-1
votes
0answers
25 views

WordPress Gravity Forms - Storing Gravity Forms data in JSON format in MySQL DB [on hold]

So I've worked this out a little bit and now I've hit a bump in the road. I am working on a record keeping site for registering people and making records of personal data. Each new record or update ...
0
votes
1answer
32 views

Multiple Media uploader output to input

I'm trying to select multiple images then insert the IDs (comma-seperated) into a text field. Here's my code, but it picks the first image ID only: jQuery(document).ready(function($){ var ...
0
votes
1answer
463 views

Simple Button onClick to trigger jQuery function

I have looked similiar questions but any of it didn't worked I want to trigger jQuery function with onClick button, but it didnt worked. HTML structure : <button class="my-button" ...
1
vote
0answers
19 views

how to localized scripts of new page requested by ajax?

I'm using ajax to load pages in WP ( all links of my theme works with ajax) and when i go from a page to another, I remove old script tag ( current page ) and add scripts of requested page ...
0
votes
0answers
17 views

Editing the source of a display for posts (to category recent)

I am trying to modify a piece of code that right now just pulls posts that have been selected in admin. The goal is to get rid of that source (I don't want to select posts), and just display posts ...
1
vote
2answers
866 views

Implementing Isomorphic JavaScript (React JS) in Wordpress?

I'm about to start with a new project and would like to incorporate React as I want to learn more about it and this specific project would be perfect to get started as it's not that time sensitive and ...
0
votes
1answer
497 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 ...
0
votes
1answer
2k 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 ...
10
votes
4answers
8k 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 ...
1
vote
1answer
28 views

How can I add Javascript in the header of all post pages and only post pages

I am using add_action('wp_head', 'function_that_returns_js_string') in functions.php but it is adding the string in the header across the site. How can this be narrowed down to be only included in ...
0
votes
0answers
25 views

Changing page's name after page creation

I have a page, I can't know the name of the page before doing an elaboration with PHP, i thought about changing the page name with javascript after discovering the page name, I have not written the ...
0
votes
1answer
16 views

wp_enqueue_script adds only the first script

function banana_scripts() { wp_enqueue_script('grid', get_stylesheet_directory_uri() . '/js/jquery.min.js', null, null); wp_enqueue_script('grid', get_stylesheet_directory_uri() . ...
0
votes
0answers
15 views

Display code in curly brackets

I have this working code '<div class="title">'+{ifset $item->post_title}{$item->post_title}+{/ifset}'</div>'+ I need to use {$item->post_title} in the following code ...
1
vote
1answer
24 views

Custom post preview without saving

I've added JS to my responsive theme which changes the preview button on the post edit page into a link to an offsite page. The page contains a 320px x 568px iframe which shows the post in the mobile ...
0
votes
1answer
44 views

How to return multiple arguments from AJAX callback function

First of all, please don't mark the question as duplicate as I didn't ask how to send arguments with ajax request. I want to receive some extra arguments on ajax success. My callback function will ...
0
votes
1answer
49 views

Run javascript upon successfully set featured image

I'm looking into running Color Thief against the featured image whenever it is set or updated. I can't seem to find any way on how to hook into this event. Currently I'm doing what I feel is a bit ...
2
votes
1answer
5k views

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

Just looking for a recommendation on the best plugin to allow javascript in a post or page.
0
votes
1answer
1k 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
17 views

Dequeue set-post-thumbnail.min.js

Want to alter the behavior how set-post-thumbnail works (add additional functionality upon successful set post thumbnail). Looking on how to dequeue the stock set-post-thumbnail.min.js script so I can ...
1
vote
1answer
443 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
0answers
39 views

How to overwrite JS variable with wp_localize _script?

The function wp_localize_script( $handle, $name, $data ); does not work when trying to overwrite the same variable, that is when calling the function second time with the same $handle and $name but ...
13
votes
2answers
2k views

Does the functions.php file ever get called during an AJAX call? Debug AJAX

Trying to figure out an issue a fellow programmer is having. I was wondering if the functions.php file get called at all when you do admin side AJAX? I know that when you do an AJAX call a part of ...
0
votes
1answer
35 views

'Lazy loading' list of posts with pagination

I have reading settings set to show 30 posts per page, and what I'd like to do is show half of the list of posts and then 'lazy load' the remaining half on scroll. I've checked out some the available ...
5
votes
1answer
401 views

Custom “Uploads” Dir: “Edit Image” in Media Library broken

Directory Structure I have customized my (local) install (dev box). The current directory structure is: ./root |- wp (WordPress Core root) \ |- wp-config.php |- wp-content (Content and ...
0
votes
0answers
15 views

login_enqueue_scripts not working with javascript

I have this little modification to the login form: // Load Jquery before login styling add_action('login_enqueue_scripts', 'my_login_jquery', 100); function my_login_jquery() { ...
2
votes
1answer
25 views

Whats the safest way to output custom JavaScript and Css code entered by the admin in the Theme Settings?

I'm creating a theme in which I've created options for the admin to enter custom Javascript and Css code in the "Theme Settings" page (created using Options API). Now I'm just not sure how to output ...
2
votes
2answers
988 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
0answers
10 views

D3.js Wordpress-relative Fills

I'm working on a project that involves a chart created using d3.js. I was given the code from a 3rd party and now have to implement it into a WP environment. I've been able to get the chart to ...
0
votes
2answers
197 views

AngularJS with route and JSON API

I tried to use AngularJS with the plugin JSON API. I have no error but the route doesn't work, and the page doesn't print the partials/... ? I changed the permalinks to %postName%. I use MAMP and my ...
0
votes
2answers
979 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
789 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: ...
0
votes
1answer
45 views

Force Download a file (Save As) instead of opening in browser

I have developed a WordPress plugin MDC YouTube Downloader. It takes an ID or a URL of a YouTube video and generates download links. When you click on a generated link, it opens the video in browser ...
0
votes
2answers
2k 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 ...
0
votes
2answers
566 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
36 views

Call to undefined function get_template_part() error on theme

PHP Fatal error: Call to undefined function get_template_part() in /var/www/public/wp-content/themes/digit/index.php on line 1 Hey guys, I am getting this error in my php error logs. I have a ...
0
votes
2answers
416 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 ...
1
vote
1answer
38 views

Linking to Files in Root Directory Outside of WP Installation

I have a website that uses WordPress for its blog (the website itself is not WordPress). So the structure is: www.website.com (not WordPress) www.website.com/blog (WordPress) I have a JavaScript ...
3
votes
1answer
345 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 ...