A client side scripting language useful for making interactive web sites

learn more… | top users | synonyms

0
votes
3answers
20 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 ?
0
votes
1answer
11 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 ...
0
votes
1answer
18 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
18 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
16 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 ...
-1
votes
1answer
30 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
21 views

WordPress Gravity Forms - Storing Gravity Forms data in JSON format in MySQL DB

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 ...
3
votes
1answer
42 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
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 ...
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 ...
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
15 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 ...
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 ...
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
22 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 ...
1
vote
0answers
36 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 ...
0
votes
1answer
34 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 ...
0
votes
0answers
14 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 ...
0
votes
0answers
9 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
1answer
44 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
0answers
32 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 ...
1
vote
1answer
35 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 ...
0
votes
0answers
65 views

How to add a Custom Mailchimp AJAX Newsletter Subscribe Form

I want to add a custom Mailchimp AJAX Newsletter Subscribe Form to my WP Blog. I found this tutorial and have followed it: http://neal.codes/blog/custom-mailchimp-ajax-newsletter-subscribe. I've got ...
0
votes
0answers
78 views

Woocommerce “Add to Cart” ajax

On the product category page, when someone clicks "Add to cart", woocomerce adds automatically "View cart" below this button through Ajax. I found that the script in /assets/js/frontend/add-to-cart.js ...
0
votes
1answer
21 views

Admin bar nodes

I write a plugin. Inside it I use php and javascript files. I also use admin bar and I managed to display it with its nodes under the root menu. I nedd the following functionality: Clicking on one ...
0
votes
0answers
11 views

open wordpress tinymce editimage dialog on image click from editor

How can i open wordpress tinymce editimage dialog instead of image edit toolbar options. I did following but not seems working editor.onClick.add(function(editor, e) { if ...
0
votes
0answers
31 views

The jquery.js and Form Lightbox plugin conflict

I'm currently building a wordpress theme and I want to add two effects. On one effect I want the header to change opacity and hight on scroll and I did that by adding this lines of javascript ...
0
votes
0answers
23 views

Javascript function to switch out images

I am trying to make a simple function that switches out small images with a large image onclick. The following setup works on the first click, but after that things go sort of haywire and images ...
0
votes
1answer
95 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
2answers
43 views

custom post with loading script per single post

I read many Q&As here on SO...(and elsewhere but they don't count...lol) I think I follow the rules of WP.org but still it does not load the scripts. Scenario: Custom template for post in Php: ...
0
votes
0answers
44 views

Dropzonejs with WPCF7

I have a form with the plugin WPCF7 and i have made it possible to upload multiple files(with drag and drop). Now the customer wants to upgrade the form too be able to upload several files at a time ...
0
votes
1answer
71 views

Adding javascript to functions.php causes problems with my template

I want a "Read on" link that moves to another part of the page when clicked. I understand the HTML bit and I have even used some nice scrolling. It works. But when implemented breaks part of my ...
0
votes
0answers
88 views

Querying latitude and longitude into google maps correctly

Im have custom fields for lat/lon and querying them into google maps. The query im using works if I know the exact number of lat/lon. $args = array( 'post_type' => 'events', ...
0
votes
1answer
78 views

Why is this jquery / java script code not working in mobile / in devices?

I have following script in my header.php : <script type="text/javascript"> /* to show back the left side bar back when the LEFT side bar is moved next/below to the center/content */ ...
0
votes
2answers
180 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
1answer
28 views

How to adjust the selector used in JS to target only the one that was clicked on?

I have a js question that has me somewhat confused. What I have is a plugin that allows following. It's working quite well, except for one thing in particular. When there are a couple of follow links ...
0
votes
0answers
15 views

What's wrong with this code? (TineMCE)

I'm trying to make a button that when it clicked, it wrap some text with shortcodes. Everything went good and I did this button, but now, I want to go to the next step which is to make the button a ...
0
votes
1answer
66 views

How to add JS snippet before closing <head> tag?

I'm setting up jQuery UI on one of my WordPress pages that uses a custom template (course-landing-page.php). I enqueued the scripts for jQuery UI the proper way, but I need to add a JavaScript snippet ...
0
votes
0answers
37 views

Not including wp-load.php in plugin

Okay, so I'm trying to get a plugin approved, and I've fixed most issues except the fact that I'm using require_once to load wp-load.php. I create a button in the admin bar, and there is a javascript ...
0
votes
1answer
148 views

Custom Wordpress+PHP+MYSQL+AJAX form, submit event not captured by Javascript, but does POST data to the DB

I'm building a little form to let users update their contact information outside of the vanilla Wordpress user management systems. I plan to use a simple CRUD setup and throw in some sanitation. I've ...
8
votes
1answer
146 views

Customizer JS API

Okay so I have been trying to educate myself to create new panels sections and controls dynamically using customizer's JS API. It has been frustrating few days and I was unable to get the exact way ...
0
votes
0answers
10 views

Javascript loading screen

Is there a javascript loading screen built into wordpress already? I have a custom metabox in the dashboard and when the user clicks on buttons inside the box some ajax fetches content. During that ...
1
vote
2answers
72 views

Problem in loading javascript in footer

I have written a small plugin where i have loaded following scripts wp_enqueue_script('jquery', plugins_url('/js/jquery.min.js', __FILE__),'','1.7',true); wp_enqueue_script('new-cycle', ...
0
votes
1answer
113 views

Passing PHP Variables to JS using Localize Script

Im trying to pass some variables (author of the post, category of the post, and title of the post) to a js file using wp_localize_script. I cannot, for the life of me get these correct. How can I ...
0
votes
0answers
53 views

Sticky Widget with scroll limit

I have a Widget fixed as the visitor scrolls down the page. At a certain point though, the widget needs to 'stop' so wider content is not covered. I found this answer at Stack Overflow (first ...