A client side scripting language useful for making interactive web sites

learn more… | top users | synonyms

0
votes
0answers
17 views

add inline javascript like wp_add_inline_style

How can I add an inline js right after my selected enqueued file? like we can do with inline_style I want to add noconflict to an external jquery file (through cdn)
0
votes
1answer
42 views

Searching & displaying results from the Wordpress database on another (Multisite)site

We have site 1, where there is a custom posttype called listings. On site 1 we have included a search/filter facility, but we have been asked to display this information on a completely separate, ...
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
21 views

How to blur the_post_thumbnail() via blur.js (jquery)?

I want to use blur.js (blurjs.com) to blur the post thumbnail. But it seems that the .js can't grab the image out of the_post_thumbnail(). If I follow the instructions from the website and build my ...
0
votes
0answers
19 views

Call/link wordpress category with jquery/isotope classes

I am working on the portfolio section of my web, and these codes i have in filter.js script (in wp-includes/js folder) jQuery(document).ready(function(){ ...
0
votes
0answers
15 views

js-methods with prefix specified

I have wordpress plugin with js-file attached for js functions. I want to escape possible error of having js functions with the same name as js functions pf other developers so I use some prefix like ...
0
votes
0answers
30 views

Isotope filtering with wordpress by categories

I am using the isotope by metafizzy script, need to use it on projects page of my website, it's working fine but what i want to do is filtering by custom post categories (portfolio categories), here's ...
1
vote
0answers
43 views

How do I pass the id of my widget to javascript in the form function?

I would like to add a Quilljs editor to the admin area of my widget, but I am having trouble passing $this->id to javascript. I am using the foo_example widget code, and I've appended the ...
0
votes
0answers
26 views

Use data-id for wordpress posts (individually)

I get the filters script implemented on my wordpress web by some developer, who's not good in wordpress functions but he did implement the filter script on web. That script is working on projects ...
0
votes
1answer
11 views

Link to page with posts of specific type

This might be a stupid question, but I am having difficulty finding an answer on google. I have a section of my site that loads 4 divs with a post title, excerpt and 'read more' link to the full post. ...
0
votes
1answer
242 views

Woocommerce Ajax Add cart not working

In woocommerce ajax add to cart method not adding when cart is empty, if cart contains something then my ajax function adds but if cart is empty it doesn't add. And no error. Here is the link. PHP ...
0
votes
1answer
37 views

Getting 404 in the Javascript

I have directory called "api" and in that I want to run a php script called "tweet.php". This script file is calling inside a JS file. However I am getting a 404. Need help to solve the issue. Link ...
0
votes
0answers
22 views

Getting Menu Items Parameters in Javascript Loop

I'm using the Menu Image Plugin - https://wordpress.org/plugins/menu-image/ It adds a image to the menu I need to extract or output the menu items ie Name, Menu-Url, Menu-image into javascript loop, ...
0
votes
1answer
35 views

Menu Details Output in Javascript [closed]

I have to output page, parameters( Page Url, Page Name, and Page's featured image) in javascript loop, one by one I think we can display it through NavMenuItems or NavMenu functions Pages displayed ...
0
votes
2answers
27 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
0answers
9 views

Customize navigation menu in the Twenty Fifteen theme

Is it possible to change the behavior of the navigation menu in the Twenty Fifteen theme so when a user clicks a menu item to open a submenu all the other already opened submenus are closed? I'm ...
2
votes
2answers
1k 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 ...
5
votes
3answers
4k 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
0answers
17 views

Detect when media select input field has been populated in a plugin

I have some code in a little plugin I am trying to make that allows a user to select an image to use : <input type="text" name="thumbnail_adr" id="thumbnail_adr" class="regular-text" ...
0
votes
0answers
41 views

Trying to update User Meta with Ajax

I am trying to make a plugin to record the users browser based location as user meta data stored as Latitude and Longitude. This current version is trying to make user meta via form, but ultimately I ...
0
votes
0answers
15 views

How to limit each front-end user to view just his own uploaded files on Amazon S3?

In my Wordpress website Users can upload video files directly to a Amazon S3 bucket, all of them use the SAME bucket for their uploads. After the upload is done each user should be able to view/delete ...
0
votes
2answers
35 views

Script not working in post content

I have this code: Search: <input type="text" id="fname" onkeyup="myfunction()"> <a id="sear" href="" target="_blank">Search</a> <script> function myFunction() { var x = ...
0
votes
2answers
25 views

JavaScript in page doesn't open new window [closed]

I have this code: Search: <input type="text" id="fname" onkeyup="myfunction()"> <a id="sear" href="" target="_blank">Search</a> <script> function myFunction() { var x = ...
7
votes
1answer
600 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
1answer
57 views

How to use Amazon Elastic Transcoder from Wordpress using AWS SDK for PHP?

Use Case: The user uploads his video from the frontend of my website in any format he wants to Amazon S3. Now I want to covenrt that video file to MPEG-4 using Amazon Elastic Transcoder by applying ...
-2
votes
1answer
29 views

How to make a rest style plugin?

I created a plugin that is basically a crud to write to the mysql database. I want to know how to display the data on a wordpress page. I'm reading about url rewrites but it seems rewrites are for ...
0
votes
1answer
28 views

How to create a dashboard for logged-in users with custom functionality? [closed]

I am developing a Wordpress website in which each logged-in user should have a dashboard from which (s)he can upload video files. Each user has an upload limit of X GB. He also should be capable of ...
0
votes
0answers
13 views

Wordpress Customizer - reload controls

I have several controls setup, one of which is a custom multi-select field which allows you to select several different options, based on these selected options I tailor make other sections/controls. ...
2
votes
1answer
44 views

What type of template are WP media-modal's templates?

I was looking at the Wordpress templates (html that's written to the page instead of awkwardly adding strings in JS). There are a lot of templates like this in a post editor for example: <script ...
0
votes
3answers
28 views

Why doesn't jQuery use $, and how can I get it do so (GLOBALLY)?

I have a WordPress theme that includes jQuery, but for some reason the "$" doesn't let me call jQuery. I know I can wrap jQuery calls in an anonymous function, but I have other plugins that rely on ...
1
vote
1answer
4k views

wp_enqueue_script() not working at all

I'm trying to enqueue JavaScript files using wp_enqueue_script(), but it isn't working at all. Here is my code: function load_css_js() { wp_enqueue_style('gdgt-base', get_template_directory_uri() ...
1
vote
1answer
21 views

I need to get an array from the wordpress database

I need to convert this code //This creates an array from the database and allows us to use it later in the jquery //CREATE SQL STATEMENT $sql_locations = "SELECT * FROM tbllocations"; //EXECUTE SQL ...
0
votes
0answers
16 views

multiple_loop of filterable taxonomy_portfolio for CPT

first sorry for my "school-level" english and for possible mistakes (it's the first time on this forum) I have a CPT "corso", I have more taxonomy for this CPT (argomento1, argomento2, ...) and I've ...
0
votes
1answer
33 views

JavaScript problem in a WordPress PAGE

I did a simple HTML page which has JavaScript as following: <script> function myFunction() { var y = document.querySelector('input[name="mum1"]:checked').value; var z = ...
0
votes
2answers
61 views

Enqueue js script to footer

I need to run wp_enqueue on javascript files after the DOM has been populated because I need to target a div. EDIT I am trying to add the following three scripts: wp_enqueue_script('react_js', ...
1
vote
1answer
28 views

What are the options for running custom css and javascript files on a page?

To include custom css and javascript within a blog post or a page, one option would be to embed a jsbin, codepen, or plunkr link. In cases where you wanted to include external libraries like ...
0
votes
1answer
166 views

How to use Readmore.js? [closed]

I am trying to use Readmore.js for WooCommerce category description "Read more / Close" functionality. I enqueue the JavaScript and add $('article').readmore(); in the "Insert Header and Footer" ...
8
votes
1answer
551 views

Is it Possible to Extend WP Customize JS Methods?

I’m wondering if it’s possible to extend the methods of the anonymous api object in wp-admin/js/customize-control.js. I need to overwrite one of these methods with my own custom logic but I suspect ...
0
votes
0answers
15 views

Can anybody explain why this js value is set at 10 in this media library source?

I'm using Mike Jolly's media uploader plugin on one of my Wordpress plugins which opens the media library as a shortened popup. Generally it works, but line 4 of the main code includes the following ...
1
vote
2answers
79 views

Searching multiple tags and adding jQuery dependant script onto page template?

I have this simple javascript file for checking boxes in a tree view menu: treeview.js $(".acidjs-css3-treeview").delegate("label input:checkbox", "change", function() { var checkbox = ...
0
votes
0answers
28 views

Call attributes from shortcode function to a JavaScript function?

How do I call attributes from shortcode function to a JavaScript function? extract(shortcode_atts( array( 'xyz' => '' ), $atts )); I want to call xyz's value in ...
0
votes
0answers
20 views

Accessing tags from the front end

I would like to access the tags that are assigned to a post from the front end (JS). Is there a hook / object I can tap for these?
1
vote
1answer
46 views

TinyMCE 4 remove/add attributes for all images

i want to search for all images that have been add to TinyMCE 4 and: Remove the height attribute from the images Add style="max-width: 100%;" to all images what is the best way to do this tasks? ...
1
vote
0answers
44 views

Using React.js in WordPress

I want to add a "Widget" that is built with React.js to my WordPress site. It will not be dependent on any outside data. Besides adding npm modules and adding build processes to my Gruntfile (to ...
0
votes
1answer
16 views

Slider from different widgets

I need some advice. I have added the possibility to pages to have categories with a plugin. I have created a widget for a client that lets a user select a category from a page and select a subpage ...
0
votes
0answers
16 views

Widget Admin page and Javascript enqueuing

I am authoring a WP Widget plugin, and am having problems enqueuing javascript onto the Widget Admin page. The Javascript works when the page is first loaded or refreshed, but when you click "Save" on ...
0
votes
1answer
56 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
77 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
2answers
34 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 ...
0
votes
0answers
20 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 ...