A client side scripting language useful for making interactive web sites

learn more… | top users | synonyms

0
votes
1answer
60 views

How do I know if I should enqueue JS code or just include it in ONE PHP function?

I've read in tons of articles that enqueueing is the way to go...blah blah blah....but does that only apply to when the JS code itself will be repeated across many pages? For example, I have a bit ...
0
votes
0answers
156 views

Get URL of current featured image with JS in edit post view

Is it possible, somehow, to fetch the URL of the currently set featured image when you're in the edit post view? So far I've looked at fetching via jQuery such as: var url = ...
0
votes
0answers
23 views

Should I be worried about this error when enqueueing an external JS file? Everything still works

I enqueued a JS file that contains the below code. I can tell that the JS file is working correctly and being used. However, the browser console gives me an error Uncaught SyntaxError: Unexpected ...
0
votes
2answers
40 views

Normal for scripts to be loaded after body tag?

Why are there WP scripts being loaded after the <body> tag? Is this the norm in WP? These scripts seem to be WordPress's own and not from the plugin/theme I am using. The image below is a ...
3
votes
1answer
163 views

Refresh wp.media after ajax call

I'm building a plugin where i add a tab to the media manager and can add stuff from another source. I add the tab with this, which generates a iframe; add_filter('media_upload_tabs', ...
0
votes
0answers
33 views

video preroll vimeo in wordpress

Hello guys I would like to integrate an open source code taken from github to my wordpress theme. link: Vimeo Pre-roll This is the code of my video.php, I would like to work with vimeo. code: ...
0
votes
0answers
47 views

WP API Get Request Dynamically Load the_content

I have formatted my posts as follows, using the normal Loop: the_title the_date the_excerpt Using a "Read More" button onclick and the WP API v2 JSON data, how can I dynamically expand the post to ...
0
votes
2answers
40 views

How to identify which javascript is being executed

I am trying to figure out which script is being called and executed within my Wordpress website. I have website with a number of scripts that are included by the core, the theme and the numerous ...
0
votes
1answer
15 views

Referencing files in JavaScript in WordPress Plugin

I have a JavaScript file in my plugin in which I need to reference a sound file to play when any link is clicked in any front end page. I did it like this: my_plugin/my_plugin.php function ...
0
votes
0answers
107 views

Adding number of items in cart at the beginning of the <title> tag using Javascript

I'm working on a WooCommerce site and I'm trying to add the number of items in the cart, inside of the <title> tag. The thing is: I've been looking for all over the place where the ...
0
votes
0answers
50 views

Change view and refresh wp.media

I'm building a plugin which adds a new media tab. In this tab i display an iframe in which i can select images from another source and upload them to wordpress (using ajax). This works just fine, the ...
0
votes
2answers
27 views

I can't enqueue my scripts - They literally aren't being added to my site

Ok, I've literally copy-pasted different enqueueing code from about 5 different sources (Including wordpress), and not a single one works. Here's the code I'm using in functions.php: <?php ...
0
votes
0answers
21 views

Protect my plugins document ready JS from errors from other plugins

I'm creating a plugin where I add some event listeners etc. Nothing fancy. I'm using the document ready event and it's working fine. The only problem is, that other plugins may cause JS errors into ...
1
vote
0answers
111 views

Making a custom widget that includes a tinymce and works in Site Origin Page Builder

For a client I'm using Site Origins Page Builder plugin. It enables the client to make rich layouts for each page by dragging and dropping widgets. Site Origin widgets that require a WYSIWYG-editor ...
0
votes
2answers
185 views

Delay JavaScript files from loading

I need to delay AngularJS scripts from running so I can set up my application first. I need to initialize the application with ng-app="app". I want to add that attribute to the < body > < body ...
0
votes
0answers
35 views

Removing options from attachment details

In the image gallery section of my Wordpress admin, when I click on an image I get something like this: My site allows multiple users to add images and I feel that most of these fields are ...
1
vote
2answers
23 views

AJAX not Working with php as supposed

I am creating a like system in PHP . My code looks like this . <?php class Like_System { private $userid; private $postid; private $user_ko_like_count; private ...
0
votes
2answers
40 views

wp_enqueue_scripts not enqueing correctly

I'm using Emberjs to build a front end to a WordPress site. It has two javascript files 1. vendor.js and 2. myapp.js. On Ember's dev server, the app works correctly but when I add the production ...
0
votes
0answers
45 views

Put dynamic Javascript in header after doing operations

I want to write a plugin that enables a function to be put in my theme in various places. Then I would like to collect the parameters called and generate a Javascript and put it into my site ...
0
votes
1answer
30 views

Video script issue, JavaScript attribute remains 'undefined'

I have a project in development and I want to use this technique to load a background video element. This should load into the large white box below the purple nav bar. So far I have added the ...
0
votes
1answer
232 views

Front end post delete error confirmation and success message

I am allowing Authors to delete their posts on the front end as they cant access the admin. I have this working, but what bothers me is the standard javascript onclick alert message - is there are way ...
0
votes
0answers
35 views

Changing post status with js

I'm having issues grabbing some actions inside a navigation menu.. So it's going like this(for the publish button) HTML <a href="javascript:updatepost()" class="menu-item fa ...
0
votes
0answers
82 views

Uncaught error when calling .select2() on widget update in WordPress widget.php

Uncaught query function not defined for Select2 s2id_widget-daily_deal_widget-__i__-select_product displays when calling .select2() on widget update in WordPress widget.php ...
0
votes
2answers
149 views

Using javascript on my site to create nested tabs

Side note: I've been designing in wordpress for only a few months, and don't know where else or how else to ask this, so my language may seem somewhat inaccurate. I'm using the Jupiter theme within ...
2
votes
1answer
128 views

Create a separate JS application for an individual post?

Automattic is building a React.js based theme called Picard. All the JS code is in picard.js, which you can see a reference to below. Although WordPress doesn't have a "router" per se (as explained ...
0
votes
0answers
128 views

How to display a featured image and register a tag for the RSS feed?

I am trying to modify my RSS feed to display featured photos while using Angular JS to display this content on another website. I am currently using the Google Feed API to manage the format of the ...
0
votes
0answers
36 views

How to link images to a certain property type

I've build a web page, in which an user certain data; the user can add also images, and once everything is done, he/she clicks submit and a Property post type is added. The problem is that the images ...
0
votes
0answers
31 views

Checking if text from product 2 is equal to product 1

I am using Woocommerce product addons to allow users to upload a pdf file when ordering 2 products. I would like the following logic to be applied when both items are in the cart. If filename ...
0
votes
1answer
53 views

Display images from JS?

How can I get images from JavaScript? Code is given below: $(window).ready(function() { 'use strict'; $.vegas('slideshow', { backgrounds:[ { ...
0
votes
0answers
22 views

Passing variables to JavaScript from multiple hooks

I use inside the hook 'wp_enqueue_scripts' the following code to deliver home_url() value to some javascript function in the module with handle 'rdhil_read_write_css'. It was fine and the javascript ...
3
votes
2answers
205 views

Trigger JS when featured image upload window is opened in admin

I'm trying to hook up some JS so that when the featured image upload box is opened and an image selected I can use Vibrant.js to analyse the colours of the selected image. The hurdle I've encountered ...
0
votes
1answer
38 views

How to stop javascript code being broken when going into visual editor

so I already had to make my code uglier than it needed to be, because whenever I tried to do && wordpress decided I wanted &amp, and now I am finding that when I go into visual view any ...
0
votes
0answers
60 views

How to use shortcode in Javascript?

I wrote a script that adds current user name to my button URL. To get current user, I use a plugin. When I use shortcode of plugin, [currentuser_username], then it displays the current user name. So I ...
0
votes
1answer
177 views

How to set the cursor to “wait” while page is loading?

I have a few pages that take a long time to load. How can I have the cursor display the hourglass or wait cursor while loading, then revert to the initial cursor? Thanks, e
-2
votes
1answer
50 views

How can I include properly javascript files in my wp plugin [duplicate]

I am creating a plugin for wordpress. And I want to know how can I include properly js in my plugin with correct path function. Thanks
0
votes
2answers
428 views

Run JavaScript validation script on form submit in plugin

I have created a small custom plugin which is just an HTML form. The HTML form is echo'd out using PHP and it includes a small JavaScript function that I want to run on submission. I cannot get it to ...
5
votes
1answer
119 views

Tinymce - How to hook before or after live shortcodes rendering?

When the edit post page loads in WordPress admin, I launch a js process which alters the TinyMCE editor’s contents. Recently I've come across the WordPress live shortcode previews which break my ...
0
votes
0answers
66 views

jQuery keyup() on Visual editor

I need to trigger typing in Visual editor and to get current text from it. Is it possible? Then next line are not working: $("visual_editor_selector").keyup(function(){alert("Changed")}); ...
0
votes
0answers
89 views

Best practice for writing backend forms to interact with database

I am responsible for a Wordpress site where ingredients, recipes, allergens and similar data is inserted into the database. All the columns in the database are separate from the Wordpress database, ...
1
vote
0answers
68 views

How to create a repeatable / reusable divs in the metabox?

I have a meta box: <?php function custom_meta_box_markup() { global $post; $meta_box_text = get_post_meta( $post->ID, 'meta-box-text', true ); $meta_box_text_day = get_post_meta( ...
0
votes
0answers
16 views

In Theme Customizer, need to reference outside control values from within checkbox's value bind

This post pertains entirely to the Wordpress Customizer (Wordpress 4.3). I have the following controls: Text input "Disclaimer" Text input "Global Disclaimer" Checkbox "Enable Global Disclaimer" ...
0
votes
0answers
77 views

Wordpress and javascript frameworks

Please advice me, At first want to say I learned about web for 2 years and after that switch on wordpress which I have been learning for 2 years at least. Until know I have made 3 wordpress sites ...
0
votes
1answer
58 views

JQuery Login Dropdown not functioning in theme

Having a problem on my demo site (http://somm.icorp.net/) what I'm attempting to accomplish is when you click on the LOGIN button a drop down appears and using JQuery, it displays a login box so users ...
0
votes
1answer
244 views

Implementing a custom form in Wordpress

I'm relatively new to Wordpress development. The Environment: Wordpress installation with newest WP version and a Child Theme being used to keep things tidy. The Task: I've created a custom HTML ...
0
votes
0answers
38 views

Event fired when file attached to a post?

I am using a Plugin called Attachments which allows you to attach any number of files which each have there own defines meta data into a post. Adding new files uses the WP Media Library shown below. ...
0
votes
0answers
38 views

foundation 5 css/js won't load in wordpress

I am really stuck with some error that I find really confusing. I have my functions.php inside my custom theme folder but why is it looking for css/js inside twentyfourteen? (index):101 GET ...
1
vote
1answer
134 views

JavaScript, best way to use data from the loop

I am trying to learn WP theme development. And at the moment I am trying to figure out how to use data from the loop in JavaScript. Lets say I got some JavaScripts functions in a external script-file ...
0
votes
1answer
75 views

print script on wordpress header after user registered

I should attach javascript snipet after user is registered on my wordpress site, i user the user_register hook like this do_action('user_register', $user_id ); add_action('user_register', ...
0
votes
0answers
36 views

How to integrate this skill simulator in a page?

So here , I would like to reproduce this page, especially the simulator in center. The administrator of this site shared a zip file containing multiple files : two files with the images , 2 HTML ...
0
votes
0answers
159 views

“window.send_to_editor” only called in Wordpress thickbox/media-uploader if “insert into post” is clicked, not “save” button

I am using WordPress's media uploader by using the javascript: function handleMediaUpload(button) { //Enables returning the URL to input window.send_to_editor = function(html) { ...