A client side scripting language useful for making interactive web sites

learn more… | top users | synonyms

0
votes
0answers
14 views

why is this ajax function not working as expected?

so my class looks like this: class Myclass{ private $nonce; public function __construct(){ if( get_current_screen()->id == 'nav-menus' ){ $this->nonce = ...
0
votes
0answers
18 views

wp_footer problem

I have a problem with a newly installed theme called QA Engine. When I use that theme, I see my server providers webpage inserted after my page's footer. I don't know what happened, and why is that, ...
0
votes
1answer
20 views

CDATA removing new line in script tag in wordpress

I am getting this error in 4.1.6 suddenly. The code below when put in the editor <script>// <![CDATA[ alert('hello'); //]]> </script> gets converted to // <![CDATA[ ...
0
votes
0answers
8 views

Custom link menu including Javascript AND “if session”

I have menu links (such as this one below) which I need to implement in my WordPress menu and don't know how : <a href="javascript:void(0)" ...
2
votes
0answers
46 views

When does Wordpress wrap inline scripts in CDATA?

I'm debugging a problem with a third party script of ours that wordpress users use by copy / pasting a snippet of script and html into their post's bodies like (non-real world example of course): ...
1
vote
1answer
13 views

Get File Object from wp.Uploader

I would like to hook into the wp.Uploader and get the FileList object containing the file to be uploaded. So far I've been able to extend the uploader using the code below, but I can't quite seem to ...
0
votes
0answers
18 views

how to toggle tag around selection wordpress editor

js : (function() { tinymce.create("tinymce.plugins.afflpad", { init : function(ed, url) { ed.addCommand("afflpad_click", function(e) { ...
-1
votes
0answers
19 views

need a good code for open and close tag wordpress editor [on hold]

hi i need a good code for open and close tag wordpress editor 1.The button on first click shoud open and on second click have to close </b> tag 2.Add active class ! 3.How to ...
0
votes
0answers
20 views

Cannot Enqueue JS Script in Wordpress Admin

I'm running through a tutorial to add some ajax functionality to the admin area of WordPress and have hit a road block. I've been trying for a couple of hours now and as far as I'm aware, the below ...
0
votes
0answers
18 views

jquery is loading js scripts with 1 script for a few sec a good aproach?

so..... I want to make a dynamic table from a mysql query and i've done it successfuly but... I dont like the idea off people being able to look at my script files. Is there anyway to avoid this? My ...
0
votes
0answers
22 views

iPad Popping Back to Page Top on Scroll

I am using WordPress, Bootstrap, and Skrollr. I have Skrollr disabled on mobile using the following code: var mySkrollrFunction = function () { var windowWidth = $(window).width(); // ...
4
votes
1answer
149 views

Move Wordpress native javascript to bottom of page?

Checking my page in google page speed insights, it complains that there are some javascript that is blocking the rest of the page from loading. The javascript in question is native Wordpress scripts ...
0
votes
0answers
28 views

Session variables lost during Ajax calls - Wordpress - Sage Starter Theme

I'm using the starter theme Sage to create a custom Wordpress Theme. I made a very simple infinite scroll system to display every posts. On that point, everything seems to work fine. Now, I have to ...
0
votes
3answers
39 views

Import HTML code that loads css and javascript into specific page

How can I add the following HTML code into one of my web pages? It's a web form that relies on css and a few java script. Below is the raw HTML code. <head> <link href="css/style.css" ...
0
votes
0answers
8 views

Hooking into action that fires in wp_head from widget on front end [duplicate]

I have a custom action hook for which the do_action() is executed in a function that hooks into the wp_head action. I would like to run add_action() for that custom action hook from the front-end ...
1
vote
0answers
15 views

Reset Undo on the tinymce editor

I have one editor where I switch between content in one editor, and what I want to do when I set the new content, I would like to reset the undo possibility. I have read on this site ...
0
votes
0answers
16 views

myCRED do_shortcode issue

i found a code to create a timer. I want to use it for delaying a do_shortcode commands but i don't work... the shortcode is execute when the timer is to 1:00 and i want to execut it when the timer is ...
0
votes
1answer
101 views

Ajax not firing properly using Firefox, but works in Chrome

I'm working on a plugin that seems to be fine in Chrome, but is not firing the PHP script via Ajax in Firefox. It is driving me to distraction. Here are the code blocks that relate to it. First, the ...
0
votes
0answers
24 views

After refresh settings field disappers

I'm working on a little plugin project to help gain a better understanding of wordpress development. So far i've been able to create dynamic text fields which a user can add themselves. Whatever the ...
0
votes
0answers
12 views

Creating a user 'add custom field' section

I'm trying to make this plugin where users can add a custom attribute for something i working on: So far what i've done is: which uses this code here: window.addEventListener("DOMContentLoaded", ...
0
votes
1answer
17 views

Including Styles and JS files to work ON my plugin interface

Hey WordPress community, I've been having a couple of issues with trying to add a stylesheet and a JavaScript file which run on my plugin interface. So far i have this: ...
0
votes
0answers
23 views

Conflicts with jQuery

I wrote a plugin that works fine, but in one site I get jQuery loaded twice even if I don't enqueue it myself (I guess the theme loads it also). I tried to deregister it and than again enqueue but ...
0
votes
0answers
26 views

Google PageSpeed Enable Compression isn't working?

I am trying to improve pagespeed of my website. When I test my site it tells "Compressing https://z-1-static.xx.fbcdn.net/rsrc.php/v2/yF/r/SQ7jeOqw5xW.js could save 188.3KiB (70% reduction)." I have ...
0
votes
1answer
52 views

Get html data with javascript to php array and store to wordpress database

What I wanted to do is get the items that are dropped to the droppable area and stored it a php array so that I can store into database so that I can access the stored array from other parts of my ...
0
votes
1answer
17 views

early enqueueing javascript file in page template, not in functions.php

Is it at all possible to enqueue javascript file early on page template file? I want to use this way of including scripts to keep my structure clean (so each page template has its own styling and ...
-1
votes
0answers
32 views

Meta Slider / Flex Slider Carousel variable image width

i tried working with Meta Slider making a Carousel that allows me to show images with the same height but different width. Thats not working somehow with flex slider. i have a sliding area of 960x270 ...
0
votes
1answer
26 views

Using google graph api with wordpress

I am trying to implement a single graph on a single wordpress page. I am using this page from google guide - https://google-developers.appspot.com/chart/interactive/docs/basic_load_libs To implement ...
1
vote
5answers
95 views

Running JS after theme customizer finished initialization

I have a piece of JS code that I use show/hide customizer control groups depending on a select item value. The code was working fine until recent wp update (not sure which version first broke this). ...
3
votes
1answer
62 views

Display message once per session to users with a specific role

I need to display a message to only users with a specific role. The message should appear either as soon as the user logs in or if they re-open their browser after having closed it when logged in to ...
0
votes
1answer
64 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 ...
0
votes
4answers
60 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
24 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
26 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
64 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
51 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
37 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 ...
3
votes
1answer
83 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
24 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
20 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
39 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
17 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
58 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
55 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
19 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
40 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
44 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
71 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 ...