Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [javascript]

A client side scripting language useful for making interactive web sites. Questions about using JavaScript outside a WordPress context are off-topic but might be asked on Stack Overflow.

0
votes
1answer
12 views

Show subcategory name selected in specific category woocoommerce

Hi basically I have categori ID number (134) that has 2 child of that (red and blue). I selected the blue one. I want to display only the selected one (blue). But at the moment the show all ...
0
votes
0answers
13 views

How can I update all product data in woocommerce based on the attribute selected or variation selected?

I want to update the woocommerce product page based on attribute selected. Normally it just shows the parent product info. So i am looking to update the data such as such as title, description, ...
0
votes
0answers
12 views

Play video on mouse over [migrated]

I have a film portfolio where I want to display some content in video on the front page instead of still images. To do this I have changed a few of my featured images to video with the help of the ...
0
votes
0answers
9 views

Limit the number of times a user can book an appointment in Timetable Schedule

I'm building a gym website using Gym X theme. For appointments, it uses the Timetable Responsive Schedule plugin. I want a user to be able to book only a limited number of times per month (based on ...
0
votes
0answers
11 views

Add JavaScript-Library “Fitty” to WordPress

as I am trying to figure this one out since hours, I've come to the conclusion, I should have a try, asking you guys. I want to integrate the JavaScript Library "Fitty" (https://github.com/...
0
votes
0answers
16 views

Explanation for Elementor Code

I am trying to have use wp_locatize_script for the elementor widget. I am confused with the method to use. I want to pass a php variable to javascript. If i am using a script file the method has to ...
1
vote
1answer
39 views

Dynamically update post title in admin page

I have a textarea in admin post page when creating new post, that's title: <textarea id="post-title-0" class="editor-post-title__input" placeholder="Add title" rows="1" style="overflow: hidden; ...
1
vote
1answer
73 views

class click counter save number

When the user clicks class count the counter should work: <div class="pop-btn" class="counter"><a href="https://www.example.com">Know More</a></div> <div class="count">&...
0
votes
1answer
21 views

Homepage Menu Link Won't Function

I am fairly new to Wordpress. I have been setting up sites using a template in a multisite installation. On the home page, one of the links "Twin Tiers Saves" is unresponsive but it shows in the ...
0
votes
0answers
15 views

Set featured image using javascript in post editor

I have built a plugin that will auto-generate an image based on some variables in the post the user is writing. They have the ability then to set some colors and stuff to make the image look nice. ...
1
vote
0answers
20 views

Display encrypted content on my website

Good day I am new here and to wordpress as well, please can someone tell me how i can automatically hide email addresses displayed on the front page(dynamic Content), see example https://quickleads....
0
votes
1answer
18 views

Append php file to footer

I have javascript in my php file. and I want to load it in footer. Is any method for that?
1
vote
2answers
20 views

Exclude JS file from 404 error page

I have a custom tracking system in place which works with an include of a .js file in the footer of each page. Unfortunately some high traffic sites are including images from my site which are ...
-1
votes
1answer
26 views

Eliminate Render blocking CSS?

OK, so I'm really struggling with a 'brand-new' WordPress website. I'm no WordPress developer, I only have some knowledge of HTML, CSS and a very basic understanding of PHP, Javascript and jQuery. ...
0
votes
1answer
14 views

VisualComposer/WPBakery Page Editor: Is any JS event triggered after the Edition pop-in is shown?

In the back-office, when we create a page, we can add sections and rows in which we can create elements. These elements are for example text boxes, images, buttons, and other Visual Composer mappings ...
0
votes
0answers
18 views

Wordpress Javascript: how to get the current frame of wp.media?

I know from the official docs (https://codex.wordpress.org/Javascript_Reference/wp.media) that you can create a new media frame this way: // Create a new media frame frame = wp.media({ title: '...
-1
votes
0answers
15 views

React Error “Target container is not a DOM element” [on hold]

This is my first time working with the WordPress build/scripts package which allows us to build our ESNext and React JS code without having to struggle with setting up Webpack yourself. I am building ...
0
votes
0answers
7 views

jQuery UI with touchpunch not fully working on touch devices

I'm currently trying to get the jQuery UI sortable function working on my Android phone (touch). Sadly, the touch event don't works on my phone. I've tried everything. jQuery("#details-inner")....
0
votes
2answers
47 views

Javascript / PHP - closing the loop

I have a HTML form embedded within a PHP file with an onclick button which summons a javascript function. <form name="addStamp"> Validation Code:<br> <input type="number" name="...
0
votes
0answers
15 views

Customise GravityForm Field to accept multiple entries

I need to customise an input field in GravityForm to be like the highlighted part of the screenshot https://snag.gy/LIOsoh.jpg The input field will have a dropdown to add Adults, Infants and Children ...
0
votes
1answer
17 views

Return 'X-WP-Total' from headers in response

I'm wondering if it's yet possible to get the value of 'X-WP-Total' in the api response. Here is my request - axios.get(${url}/wp-json/wp/v2/media?per_page=100&mime_type=image/jpeg).then(...
-1
votes
0answers
17 views

JavaScript onclick event with multiple functions

I have two buttons. Both have hyperlinks to IP addresses. My question is how can I redirect to the IP address & logout? <!DOCTYPE html> <html> <head> <title>Title ...
0
votes
1answer
17 views

How do I integrate a codepen?

EDIT: Answered own question with some fiddling around Bit of a newbie question but sure someone here can help: I am simply rubbish with JS but am learning on my feet. I have created a simple ...
0
votes
0answers
10 views

How to get value of selected page template in Gutenberg editor?

How to detect the value of selected page template in the edit page? I have used jQuery to select the page attribute select box but it is not working when we hide the editor sidebar; Because it removes ...
-1
votes
0answers
11 views

How to lock post screen with a banner right after 10 seconds of visitor duration?

How to lock wordpress post screen with a banner right after 10 seconds of visitor duration? So visitor will visit the post and then 10 seconds of viewing then they will see a banner (content locked) . ...
1
vote
2answers
20 views

Force uppercase on some WooCommerce checkout fields input

I'm using this code to limit max number of characters to a determined field... is it possible to force UPPERCASE? Here's what I'm using: add_action("wp_footer", "cod_set_max_length"); function ...
0
votes
0answers
9 views

rerender gutenberg facebook embed widget after API content loaded

Is there a helper function for rerender gutenberg embeds after SPA's content is loaded, pls? I got embed block from post's content, but is not rendered as facebook post widget, just wrapped url. For ...
0
votes
0answers
10 views

Filter portforlio with librairie isotop

I'm doing a php filterable portfolio and also with the Isotop.js library. Having followed a tutorial. I do not understand why my filter system does not work. I created my categories and my projects ...
0
votes
0answers
20 views

How to block specific keywords from searching and redirect them to custom page on Wordpress?

I'd like to block some specific banned keywords from searching and redirect to custom wordpress page when someone search these specific keywords on WP. I'm gonna use the below code for banning these ...
0
votes
0answers
14 views

Woocommerce - Change variations output

I'm looking for a way to customize the output of the variations selector. For example, I have shirt size and color, and I want to transform the color field in a custom radio button, and showing the ...
0
votes
0answers
22 views

How to improve WP-Rest atrocious response time?

I'm going to be very straight forward here. I have a headless WP install and made my front-end in Vue.JS Since I've started this project, the load times for the API requests were high but I think we ...
0
votes
0answers
24 views

How to auto delete posts with specific keywords titled,tagged via cron?

I'd like to automatically delete all posts which contain specific keywords in their titles and tags via cron. How to do?
-1
votes
0answers
15 views

Javascript malfunction

I have been using a older theme, but have not had problems until recently on some pages, but javascript simply displays the text and not the actual execution of the code. I have a drop down menu that ...
0
votes
1answer
38 views

How to block specific keywords from searching on WordPress?

I'd like to block some specific banned keywords from searching on WordPress. Or I'd like to show a redirect when someone search specific keywords. How to do?
0
votes
0answers
17 views

XMLHttpRequest to open PHP file responds with Missing Page

I am using CBM2 plugin within my own custom plugins. I need create my own file uploader so that the file will be stored at a different location than the metapost table within word press. Thus I am ...
0
votes
0answers
19 views

Using existing ajax data that is loaded into page

Hey guys thanks in advance, is there a js function that I can use on an existing data that was generated by a plugin with an ajax request ? Iv checked it is loaded with the network tab. but I'm not ...
0
votes
0answers
41 views

How can I set cookies on my posts so that I can get view count of that post [duplicate]

Can anyone help with the solution? This is my post and I have created a custom column to get view counts on my single post. I'm want to keep a track of views for every single post. I'm trying to set a ...
0
votes
1answer
35 views

How to keep HTML form field that is conditional hidden with javasript hidden after page reload?

I have an html form in which I conditionally hide a field with javascript if an option is selected in the dropdown. The javascript condition works fine but when the page is reloaded the condition is ...
0
votes
1answer
10 views

I can't load my images from a js file using wp_localize_script

I am using a slider to show my images that works fine on my sit but when I converted my site in to a wordpress theme it started giving me troubles on loading the images, slider is active but images ...
0
votes
0answers
27 views

Uncaught SyntaxError: Invalid or unexpected token

Since i updated my wordpress to the latest version, i got these errors on web browser console. Also my header seems broken. Tried some solutions, even i re-installed wordpress. But i still have same ...
0
votes
1answer
27 views

Insert Into Post Not Working For Audio File Using jQuery

I am trying to insert an audio url from the media library into a field in my custom metabox. I used jQuery to do a similar action but to grab an image url instead and that is working perfectly. For ...
0
votes
1answer
22 views

How to allow download url redirection only if user logged in Wordpress site?

I'm trying to allow url-redirection (from /dl urls) only if user is logged-in to wordpress site. Otherwise don't allow. However it went "page not found" when i click these urls with or without logging ...
0
votes
0answers
26 views

How to check if a user is logged into WordPress via perl-based download script?

I'm trying to implement code into a perl-based download script in order to check if a visitor to a download url has logged into WordPress. Otherwise do not allow the download. The direct download ...
0
votes
1answer
24 views

How can I get the standard WP-Editor through Javascript?

In PHP I can do wp_editor( 'content', 'editor_id', array() ); And the result looks like this: The standard WP-Editor with all the buttons, plus my custom button (the blue square). I have tried to ...
0
votes
0answers
17 views

Open MediaUpload from external component in Gutenberg

Gutenberg has MediaUpload component that allows selecting images from media library (its docs). It allows to pass button to a render property, for example: <MediaUpload onSelect={ ( media ) =&...
1
vote
2answers
44 views

How to change redirection route to a php page for making it only accessible by logged-in members?

Background of my problem: I'd like to mask external download links as internal links and to be only accessible by logged-in wp users at htaccess level or with PHP script but when redirection happens ...
0
votes
1answer
39 views

wp_nav_menu not working correctly in my underscores theme

I'm using a theme based on underscores, and I have registered my menus in the following way. function register_my_menu() { register_nav_menus( array( 'primary' => esc_html__( 'Primary' ...
0
votes
0answers
27 views

How to create a mobile menu full screen overlay using Understraps Bootstrap 4 theme

I'm using the Understrap theme for Wordpress and looking to modify the default menu on mobile when the user clicks the hamburger menu. Essentially I am trying to get the menu to fully overlay the ...
0
votes
0answers
12 views

No Javascript files loading when enabling plugin?

Quick question: as someone who is using Wordpress a lot, I am first time ever noticing that I can't see any Javascript files associated with my plugin (ULike plugin) on my website. The HTML is loaded, ...
0
votes
0answers
17 views

WordPress ajexified button to load post, I have code just need some modification

Working of the below code:- It shows the recent 5 posts from news category and the button is ajexifed which load the older post of news category. Can anyone help me with this, The below code is ...