A client side scripting language useful for making interactive web sites

learn more… | top users | synonyms

1
vote
2answers
196 views

How to load javascript file on homepage in Wordpress in order?

I am using a quicktags plugin, which was not loading on the home page, now it does, but it does it on the wrong place. How can I solve this? I want the quicktags.min.js file to load first, rather ...
1
vote
1answer
38 views

a child theme not de-registering a patent javascript file

We're currently rolling out a number (>100) of wordpress sites where we're using a custom child theme and a holding page plugin. Most of our clients use IE8 as their browser (corporate policy) and ...
0
votes
0answers
548 views

Add jQuery Validation in Gravity Forms Form

So I have some jQuery functions that adjust my column layout on window load and window resize. They are inside a file called bp-columns.js that looks like this: jQuery(window).load(function () { ...
1
vote
3answers
335 views

How do I sanitize a javascript text?

I have a textarea that will receive a js snippet(Google Analytics). Is there a way to sanitize that? Since I cannot use functions like wp_filter_nohtml_kse(), what should I use?
0
votes
1answer
56 views

Showing Different Code on Pages With Different Layouts

I have pages and posts on a WordPress site. The pages have various layouts. Parent pages are following a 2-column (maincontent + right sidebar) layout while child pages have a one-column layout (no ...
0
votes
0answers
31 views

cookies creating bugs and interfering with js and correct images and css display when login in the back office

i have experienced weird behaviours with custom js functions output as well as contact form correct display. I have localised a problem being , everytime i connect to admin , i need then to clear ...
1
vote
1answer
124 views

Trigger Customizer saving process with Javascript only

I'm working on a custom theme that uses WordPress Customization API to let the user play with parts of the content of his website, basically the front-page which he can modify by adding/removing ...
0
votes
0answers
38 views

3.5.x Theme Customize: Handling Custom Control Requests

I am extending the WP_Customize_Image_Control as a means to include an upload-able word mark for a site. The control works just fine, but I need to do some post process handling on the image (i.e. ...
0
votes
2answers
324 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
1answer
250 views

Creating a custom wordpress widget and stopping js from running twice(once in active widget once in widget selector)?

Ok so here's the question how do i stop js from running twice on the widget.php page? I am creating a ajax loaded custom image selector from a domain on the same server as the current site. I want ...
5
votes
1answer
311 views

How to load wp_editor via AJAX

Does anyone know how o load wp_editor via AJAX in WordPress? My markup and editor is getting loaded properly but editor controls are not getting loaded properly, it may be because Javascript is not ...
0
votes
1answer
117 views

Localizing methods for jQuery append prepend wrap parent

So I am serializing some options in WordPress and then localizing them to be used in my jQuery script, however what I am trying to do next isn't working. jQuery('.advert')+ lu_ban_object.method ...
0
votes
0answers
126 views

Replace Short code in Visual Mode - WYSIWYG editor

I write a code in functions.php to make shortcode [template_url] and [site_url] in WYSIWYG editor. Its works fine for front end. add_shortcode('template_url', 'replace_shortcode_template_url'); ...
0
votes
0answers
43 views

Detect WYSIWYG editor - Visual or Text Mode

Is there a Way to know the editor is now in Visual mode or in TEXT mode, so i can trigger something. And also how to make default editor mode in Visual mode [ force to show Visual Mode ]
4
votes
1answer
369 views

Unable to get Preview of Uploaded image within a Custom Meta box

I first followed the steps in this tutorial. Added the Image Uploader, tried it out but I realized it's an older version of the WP Uploader... So I then found this post, and now my uploader is ...
0
votes
0answers
93 views

How to load external ads script?

I am trying to load this script on wordpress, but it is not loading <script type="text/javascript"> var ord = window.ord || Math.floor(Math.random() * 1e16); document.write('<script ...
1
vote
2answers
51 views

How do I add JavaScript that will execute on all my sites in Multisite?

We are creating an internal network of sites using MU and there are some small things we would like to have globally on all the sites without having to add them individually for each site. I would ...
1
vote
1answer
135 views

Best approach to fetch data from wp options to js file or php file

I am creating my first ever plugin, as I am not a programmer, I have been following tutorials and reading the codex, etc. My plugin consist in showing a notice to users when certain conditions are ...
0
votes
2answers
39 views

Trigger a function during onload

I recently added Javascript and CSS files into the wordpress. All the files are being registered through functions.php. One of the files is my_worldmap.js as shown below $(function() { ...
0
votes
1answer
34 views

Load custom script on a single template

So I placed two scripts in the plugin folder, but I can´t figure out why they wont load. I created a custom template where I have placed the following code: <?php function my_enqueue_scripts() { ...
2
votes
1answer
64 views

3.5 media.editor: what is the event listener for choosing an image?

What is the event listener for selecting an image in the media.editor javascript. I am attempting to add a multiple image selector to a custom plugin, and I need to show the user what images they have ...
1
vote
1answer
76 views

Can't load a class into WordPress post editor's content field

Following to THIS WordPress QUESTION we tried some tweaks and got some nice solutions, hope we can public them after some good active codes-snippets. According to our procedures, we correctly ...
1
vote
1answer
152 views

ASCII to Unicode conversion and then save the data into database using WP post editor field

Here is the WordPress default post editor as we know: You may notice, here are some garbage texts in the Title and Description field. They are ASCII texts. PLOT In Bangla, a widespread software ...
2
votes
1answer
249 views

Menu Link Redirect Based on Username or User ID

I am building a client portal where my clients can log in and see all their pending projects, completed projects and create new projects. Though I'm stuck at the start. The dropdown menu is called ...
0
votes
1answer
89 views

Saving div elements generated with jQuery [duplicate]

I have certain blocks of code like BlockA(a,b,c) and BlockB(b,d,e) and so on where these a,b,c, etc.. are all input fields. All these blocks are hidden initially with css and post editor has the ...
0
votes
0answers
61 views

Javascript not defined but included

I am attempting to implement a javascript function within a page. It is implemented correctly in the header and loads correctly: <?php function forceNumber2() { wp_enqueue_script( ...
2
votes
1answer
126 views

AJAX issue - Uncaught SyntaxError when processing Zip File

I'm creating an application that will allow a user to fill out a form and then have a customized zip file downloaded for them upon submit. I'm utilizing AJAX to accomplish this task. ...
0
votes
0answers
18 views

Custom Div (googlemap) in wordpress page

I'm using a theme called Energy that I purchased on themeforest last week. I have created a nice homepage using the wordpress backend thanks to the nice features and methods that came with the theme. ...
0
votes
1answer
41 views

How to add 3 weeks to the_time() function

I have a WordPress blog where I need to display an image on each post only for 3 weeks. This means that after 3 weeks have passed, since each post was published, the image will disappear. First, I ...
0
votes
0answers
11 views

Defer javascript [duplicate]

Is there a way to defer javascript when enqueuing javascript file in theme functions? Something like this: <script src="demo_defer.js" defer></script> But used in the content of this: ...
0
votes
1answer
310 views

Javascript on Registration Page

I've been trying to figure out how to implement javascript on my registration page with no luck. I've read the documentation on wordpress about properly including js, have searched for relevant ...
0
votes
0answers
79 views

featured post show in category base

i have 2 featured post in 1 div id, 1 big class and 1 small class . i want big featured div are post in category base.. big featured post code show in below. <div class="main_feat"> ...
0
votes
1answer
42 views

Newest version of javascript

Doing updates to my site and all the files seem to update ok, except the javascript files. I think this is to do with the version, but try as I might I can't get version numbering to work. ...
0
votes
2answers
67 views

random reason on refresh

I am editing the sidebar widgets and have added one for users who are not logged in or registered. the widget requests that users register or login and I am wanting to add a random reason (quote) as ...
0
votes
0answers
168 views

Save Changes function after table is sorted using jquery

I have a simple table, and the jquery works great for sorting. The fields drags an drops perfectly, and updates then and their. Also of course the data in the fields are saved in a array. The data in ...
0
votes
1answer
100 views

Set start page depending on screen width [closed]

I'm building a responsive theme and would like to have different start pages depending on screen width. In this case, the start page is set in WP admin and contains an image map built on a cunstom ...
0
votes
2answers
190 views

How/Where is editor.min.js Added to the wp-admin Post Page?

How/Where is the wp-admin/js/editor.min.js file added to the backend WordPress post editing page (wp-admin/post.php)? How could I change this to use the non-minified file? I'm working on a browser ...
2
votes
1answer
146 views

update_option in javascript

So there's function in wordpress to update a named option/value pair to the options database table: <?php update_option( $option, $new_value ); ?>. And what I'm trying to do implement this ...
3
votes
1answer
2k views

Ajax Load More Posts in Category Page

I am developing a theme where I need to load more posts with ajax. Currently, when I click load more on the category pages, all the posts are loading. The category.php looks like this : ` ...
0
votes
0answers
16 views

embedding php in javascript to switch out image in child theme [duplicate]

I am trying to embed a some php in my javascript to switch out images... $(document).ready(function() { $('.small-port-images a:nth-child(3)').click(function() { $('.large-port-image ...
0
votes
1answer
612 views

How to turn off automatic operation for Nivo Slider?

I am using Nivo Slider plugin to run a slideshow on my site. It automatically runs a slideshow on top of my screen. However I want the user to do this manually (clicking to advance to the next ...
1
vote
1answer
112 views

JavaScript && operator in visual editor

I am used to of adding javascript/jquery code in posts via visual editor but it seems I never used && operator cause wordpress is altering && operator in &. Here is a link where I ...
0
votes
0answers
40 views

One page site (returning from google) + history manipulation

I am making a one page site using wordpress. The one page has all the menu pages linked into one, but there will be arbitary pages (landing pages) for subcategories and stuff at the moment. I have ...
0
votes
1answer
105 views

Replacing WordPress Icons (menu,icons32, etc)?

I want to replace wordpress admin sprites. I recreated the images and looked answrs for icon replacement using jquery and simply with CSS BUT what about ones link icons32-2x.png where I can't find the ...
0
votes
1answer
24 views

Covert Wordpress Blogname into JQuery

Here is the blogname in php <?php $blog_title = get_bloginfo('name'); ?> I want to convert it to javascript. The file I want the blog name is in a .js file so I cant create the variable with ...
1
vote
1answer
54 views

Display the number of unseen comments on a page since the user last visit

The community is private and it has several pages /wordpress /design /etc . When users go to those pages the only thing they can do is to comment. Now, what I am trying to do, Idk if possible, but if ...
0
votes
0answers
19 views

Lightbox Post Pop-up on homepage [duplicate]

I've been working on sampression lite theme and what I want to achieve is when a post' thumbnail/read more link on homepage is clicked, a modal will pop-up ( similar to pinterest and this wp theme ...
0
votes
0answers
51 views

How to utilize theme customizer live preview in this situation?

Short version: I am using the theme customizer in my theme and javascript for the live preview. I am not sure how to implement the javascript for php(as seen in code excerpt). I am creating a theme ...
0
votes
1answer
56 views

Loaded JavaScript file not showing [duplicate]

I'm working a custom WordPress site, and I've loaded all the required JavaScript file: wp_enqueue_script('easing', get_stylesheet_directory_uri() .'/js/diapo/jquery.easing.1.3.js'); ...
0
votes
0answers
158 views

how to retrieve subcategory related to category in edit page from view page by using javascript

I am doing a basic product page by using JavaScript,php and html. I retrieve the category related subcategory drop down list from view page .but my subcategory is not change according my category .I ...