Questions tagged [wordpress]

Looking for answers to your WordPress queries? Look no further than wordpress. This website is specifically designed for programming-related questions about the popular content management system, WordPress. Please note that inquiries about theme development, WordPress administration, management best practices, server configuration, and similar topics are considered off-topic here. For such concerns, we recommend visiting wordpress instead.

What is the best method for preserving the state of a custom checkbox field in the WooCommerce checkout process

I am facing an issue with the update_post_meta function. I am receiving a user-submitted value via $_POST and trying to save it to post meta. Everything seems to be working correctly, except when the value is '0', the post meta does not get upda ...

The file admin-ajax.php is unable to locate a predefined ajax action

At this point, I find myself needing to reach out and ask for your assistance. There is a specific part in the admin-ajax.php code that is supposed to check for your registered ajax action. However, I'm encountering an issue where my action is not be ...

Optimal Usage of URLs in WordPress Style Sheets

I've been doing extensive research on the pros and cons of using relative versus absolute paths for images in my CSS. After perusing this online discussion, I am leaning towards utilizing absolute paths. My primary concern is not so much about cross-domain ...

Vue.js App encounters Recaptcha contact form 7 with a status of "spam"

I recently developed a Vue.js application that operates on a subdomain within the same main domain as my WordPress site. To submit a form to the contact form 7 rest API, I utilized the axios package. However, every time I submit the form, I receive a respo ...

Can you provide the XPath query to extract an href link from any website?

Looking to retrieve social links from the following URL: Check out Mahesh Waghmare's profile picture below: Member Since: October 6th, 2012 Pune, Maharashtra, India Wordpress Developer Connect with me on: https://www.facebook.com/mwaghmare7 ...

Is there a way to automatically click the 'next' arrow on my image slider?

I'm currently working on a website that uses the Semplice theme in Wordpress. The built-in slider doesn't have an autoplay feature, so I attempted to use jQuery to automatically click the 'next' arrow every 5 seconds. However, I ran into an issue where it ...

Incorporating Social Share Buttons to Enhance User Engagement on Your WordPress E

Looking to enhance my product page by adding social icons right below the 'Add to Cart' button. The product page URL is https://flowersforeveryone.co.za/product/cheerful-orange-tulips/. I already have a 'social menu' set up. How can I ...

designing the border at the bottom of the existing menu selection

I am trying to enhance the look of my current-menu-item div by adding a border at the bottom. It seems simple enough to achieve this by simply including the border in the div. However, I'm facing an issue with the width and position of the border. Ide ...

Implementing a document update event using jQuery

On my WordPress site, I am using a responsive lightbox plugin. When an image is clicked, it opens a popup box with the ID fullResImage. Now, I would like to incorporate the Pinch Zoomer function to it. Do I need to bind a function for this, or is there a s ...

Load a WordPress page with the help of jQuery

When using jQuery's load function to load a localhost URL (e.g. localhost/wp/contact), everything works perfectly. However, once I upload my site online and change the URL to devric.Co.cc/contact, nothing loads. Could this be related to the htaccess f ...

Contact Company by Sending Email According to Selected Product Dropdown Choice

If a customer selects a specific business option from the dropdown menu on the product page, I want to send the standard WooCommerce Order Confirmation Email to both the site admin and that selected business. Backpack $50 Choose an Option Business First ...

When clicking on a Wordpress category link, it unexpectedly redirects to the uncategorized category instead of the intended

I am experiencing an issue with a WordPress category link redirecting to "uncategorized" instead of the specific category. I have changed the name of the "uncategorized" category to "test", but it is still not functioning correctly. Below is the code I am ...

What is the best way to monitor a link within the content of a WordPress post using Google Analytics?

Hello, I am looking to track the number of clicks on a link within a post using Google Analytics while users read the article. Is there a way to do this without relying on plugins? I tried adding the necessary tag in Google Tag Manager and modified the ...

Show the name of the current user in a WordPress form using a readonly input field

How can I display the logged-in WordPress username (display name) in a form input field that is set to readonly? I have already checked out the Function Reference/wp get current user, but haven't had any success with it. Take a look at the code snippet I ...

The persistent issue with Wordpress thickbox ajax continuously resulting in a return value of

I am facing a problem where I need to open a pop-up for the settings page in my plugin's admin end. I have utilized WP default thickbox for this purpose, and below is the code snippet I used to call my ajax page within the thickbox: tb_show($(this).data(' ...

Discover an effective method to retrieve selected product categories' order items in the latest version of Woocommerce

Is there a way to retrieve specific order items from a particular product category in Woocommerce? I've thoroughly searched through the Woocommerce documentation, but unfortunately, I haven't found any relevant information. Below is my current code snipp ...

The operation is unable to be executed in an external document

Working on a WordPress page, I am utilizing the Google Maps API. The functions in my file are as follows: function custom_map_style() { // Enqueue Google Maps API wp_enqueue_script('maps', 'https://maps.googleapis.com/maps/api/js?key=YourAPIKeyH ...

Display specific posts on WordPress using their unique IDs

I'm facing a bit of a dilemma here - I really need to retrieve one or more posts solely based on their unique ID. Right now, my current code looks like this: <?php $post_id = 1; $queried_post = get_post($post_id); $content = $queried_post->post_cont ...

The mobile menu toggle functionality is malfunctioning on actual mobile devices, however, it is operational when tested on various mobile sim

Recently, I noticed that on , the menu collapses into a hamburger icon for mobile. However, when tapping on it on my phone and other devices, nothing happens. Surprisingly, it works perfectly fine when clicking on it in mobile simulators within Google Chro ...

In the world of PHP, is it possible to EDIT content and simply CLICK on "Publish" to update all posts using Wordpress?

Need help with the following tasks: 1) Implement a function in the post editor of Wordpress. 2) Trigger this action when clicking on the "Publish" button. Note: I am looking to import either a PHP or JavaScript function to automate these steps during po ...

Retrieve JSON data from a WordPress site that is powered by WooCommerce, using basic authentication

I am in the process of creating an Android application that retrieves product data from a WordPress site. The website has the Woocommerce plugin installed. I have been able to successfully obtain the JSON data using Postman software and basic authenticat ...

Implement a jQuery function to interchange images between variables

I am currently working on a project using Wordpress and ACF to develop an interactive image gallery. I have successfully implemented a feature where, upon hovering over an image, it will swap with another image from the database. However, I am facing issue ...

Category-Specific Page Display

Can anyone help with CSS coding using Wordpress Elementor to make a page only display posts from the coaching category? I attempted to use this selector article.type-post:not(.category-coaching) { display: none; }, but it doesn't seem to be functi ...

The Wordpress plugin's Ajax function is giving back a response value of zero

I'm facing an issue where I am attempting to send AJAX data to my wordpress table, but the response I receive from my PHP script is always a 0. This problem arises specifically on the admin side of things. Can anyone provide assistance? Furthermore, ...

Covering a secret link with a backdrop image

I have set a background image in a column on my WordPress site. However, I want to make this image clickable by placing a transparent box over it, as background images cannot be linked directly. #container { background-image: url(https://www.quanser.c ...

Obtain the initial row (image) from the ACF repeater field

I am currently utilizing the ACF plugin on my website and looking to showcase only the first row (which contains an image URL) of a repeater field from child pages, all on a single page. On my website page, although all images are loaded, only the first o ...

When I followed the instructions in section 3.1 and pasted the PHP text into a new file called service.php, I encountered an issue where nothing appeared when I attempted to run the file at http://mydomain/service

While following this tutorial, I encountered an issue with my Bluehost hosting service and WordPress. Can anyone help me understand why I am receiving an error message when entering the URL? <?php // Establish connection $con=mysqli_connect("loc ...

Ensure proper escaping of PHP special characters in Elementor and WordPress integration

I'm attempting to add this code into Elementor's Custom Code section in order to modify the Sale Badge Text on WooCommerce add_filter(‘woocommerce_sale_flash’, ‘edit_sale_badge’); function edit_sale_badge() { return ‘TEXT-GOES-HERE’; ...

I'd like to be able to log in using my username, email address, or phone number on

My goal is to allow users to log in to WordPress using their username, email address, and phone number. The challenge is that I am storing the phone number in the User meta data during registration. Are there any hooks available that would allow me to ac ...

Trigger a PHP script to execute whenever a user updates a row in a MySQL/WordPress database

I am currently in the process of developing a small web application that will retrieve data from a specific row in a database on a WordPress based website. This data will be used to populate an announcers section for a radio station on another website. Th ...

Theme's functions.php file can utilize AJAX action for dynamic loading

After some investigation, it seems that the wp_ajax_my_action function is only functional when placed within a plugin. I'm curious if there's a way to make it work directly in my theme's functions.php file. Any ideas? ...

The Wordpress admin-ajax.php script is failing to process the function and returning a "0" error code

I have been experimenting with processing AJAX requests in Wordpress and I'm following a particular tutorial to achieve this. The goal is to create a basic AJAX request that will display the post ID on the page when a link is clicked. The Approach ...

"Hello there, let's chat about the need for require

I have been trying to organize my files by separating them and not putting everything in the function.php file. Here is what I have done: function required_theme_files() { require_once( get_template_directory() . '/inc/customize/color.php' ); ...

Is there a way for me to utilize WordPress functions within my PHP script that is being called via AJAX?

Is there a way to make the 'POST' side branch of my PHP script 'WordPress-aware' so that I can call native WP functions from within it? The situation is as follows: I am trying to call a WordPress function (get_avatar($id)) from a PHP s ...

Is it possible to switch variations in WP-Commerce from drop-down menus to text input

Currently exploring ways to customize the size variations on an e-commerce website similar to Using WP Commerce, the size variations are originally displayed in select fields by default. <select class="wpsc_select_variation ...

What steps can I take to troubleshoot the issue of missing data on my screen?

I have developed a custom WordPress plugin to fetch token data from PancakeSwap, but for some reason, the data is not displaying. I would appreciate it if someone could review my code and help me identify the issue. Thank you in advance. <?php /* Plu ...

Using JavaScript within HTML documents

Need help with inserting JavaScript code from Google: <script type='text/javascript'> googletag.cmd.push(function() { googletag.display('div-gpt-ad-1362706866260-0'); }); </script> into existing JavaScript / HTML code: va ...

The Isotope Error of Uncaught Type

I am currently in the process of developing a custom Wordpress theme and have been attempting to integrate Isotope into it using a tutorial I found online at this link. However, I've hit a roadblock with the jQuery portion of the tutorial. Upon checking m ...

Adjusting a field in Gravity Forms by implementing a filter to assign a fresh value

I'm currently working with Gravity Forms and I am facing a challenge with updating a single field value using a filter. The following function has been effective in achieving this: add_filter( 'gform_addon_field_value_10_3', function ( $fiel ...

Tips for compressing multiple images into a single file using php after they have been downloaded

I have a PHP code that downloads multiple images from private websites. My goal is to place all these images into a zip file. How can I achieve this? <?php $num = $_POST['num']; for ($i=1; $i <= $num ; $i++) { $url_to_image = $_POST['img']. ...

The strange behavior of WordPress's wp-admin interface

I set up a WP docker container that is officially provided. It's currently running alongside an nginx instance. Below is the content of the .htaccess file that I have added to the container: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / R ...

Focusing on a particular iframe

I am currently using the "Music" theme from Organic Theme on my WordPress site and have inserted this code to prevent SoundCloud and MixCloud oEmbeds from stretching the page width: iframe, embed { height: 100%; width: 100%; } Although the fitvid ...

The Wordpress thumbnail image is visible only on the category page

There seems to be an issue with adding a thumbnail using the 'Featured Image' option on my website. On this site, you'll notice that the first three posts do not have any images displayed, even though I have added featured images to them. Strangely, if you ...

Combining Angular with WordPress

I need to integrate an Angular ticket sales form onto the main page of my Wordpress site. What is the best method for accomplishing this? Should I consider using an iframe tag or are there other solutions that may be more effective? Thank you for your as ...

Issue with Contact Form 7: AJAX submission failure leading to redirection to 404 error page

I've been hard at work building a new website that involves using the Wordpress plugin Contact Form 7 to manage form submissions and ideally show a response through AJAX. However, I'm struggling to get the AJAX functionality to function properly. When I s ...

Limiting Entry to WordPress admin section According to Role

Need help restricting access to the admin area in WordPress version 3.6 based on user role. I have tried the following code, but it only prevents users without administrator access and ignores my custom role "Super User". It just keeps redirecting to the ...

Ways to execute a tailored field post meta function within an array

Hello, I am trying to include a video link in a custom field. This is the code I am using: <?php the_post_thumbnail('slider-thumb', array('class' => 'rsImg', 'data-rsvideo' => 'http://www.vimeo.com/61 ...

Is there a way to remove a certain child category post from appearing in a parent category?

I'm having trouble with displaying related posts by category while excluding a specific category. I've tried different methods but none seem to work, and I'm not sure how else to approach this issue. <?php $categories = get_the_terms ...

Utilize TinyMCE in your WordPress plugin

How can I integrate TinyMCE into my WordPress plugin? I have a textarea in the backend script that I would like to convert into a TinyMCE WYSIWYG editable field. Is there a method to achieve this? The following code snippet is not yielding the desired re ...

Conceal the div element when located beneath an ordered list with a designated

I need help hiding the display of comment information if it is a child comment. Below is my attempt to hide the div with the id "info" if the "ol" element has a class of "children". If you have another method for hiding the div when the comment is a chil ...

Track WordPress Post Views on Click using AJAX

Is there a way to track the number of post views on my WordPress site using AJAX when a button is clicked? Currently, the view count only updates when the page is refreshed. I want to be able to trigger this function with an AJAX call. Here is the code I ...

What's causing the zero to appear after the ajax call?

This is my first time learning Ajax with WordPress and I'm trying to implement Ajax functionality with a widget. However, I am encountering an issue where I get a 0 after the form is submitted. Can someone provide guidance and explain why this is hap ...

Designing a unique form in Wordpress with custom file upload functionality

I am struggling with implementing file upload functionality in my WordPress PHP page. I have a form that updates a database with input field data, but now I want to be able to upload a file/picture to a specific folder and store the link in my database. ...

Tips for Removing a Page from the Sitemap on Wordpress

Looking to Exclude Specific Pages or Posts From Your Wordpress Sitemap? I've tried using this code to exclude posts from a specific category or tag from the sitemap, but it doesn't seem to be working. function sitemap_exclude_taxonomy( $value, ...

Utilizing the jQuery library for flexible REST API requests with the incorporation

I'm currently utilizing jQuery getJSON to fetch posts from the WP API v2. There are some input fields that I'd like to make clickable, and then add extra parameters to the request URL. Here are some example requests: Posts - https://www.example ...

Could it be a mistake causing Echo to fail in fetching information from advanced custom fields?

When setting up in-content advertising for my blog posts on WordPress, I wanted the ads to point towards other sections of my site. Everything was working fine with the shortcode [in-content] pulling the most recent post from the 'advertising' custom post ...

Wordpress Custom Post Type with a Sleek Slider Plugin

I am currently using a static slick slider to display testimonials on my website. Instead of hardcoding the testimonials, I want to fetch them from a WordPress custom post type that I have created. Can someone guide me in the right direction: <section ...

Custom taxonomies in WordPress offer a powerful way to organize

Is there a way to display a list of all custom taxonomies that are siblings to the current page in single.php? Here is an example of my taxonomy structure: Categories -- Ancient +++ Greek ///// Plato ///// Socrates +++ Roman +++ Indian -- Classic -- Mo ...

Local Wordpress pages have ceased to function on my computer

While managing my WordPress website, I had previously installed a quick cache plugin on my XAMPP server localhost. However, all of a sudden, the pages stopped working. The site is currently not hosted online but running on my local machine. Upon inspectin ...

Linking the bridge between Woocommerce Subscription and Account Funds plugins

After purchasing two plugins, Woocommerce Subscriptions and Account Funds, which claim to be compatible in their documentation, I am attempting to create a Simple Subscription product that adds the product price as account funds for the user upon checkout, ...

Determine if Products are Currently in Cart in WooCommerce

Recently, I came across a helpful code snippet on this website Here is a function that can be used to check if a specific product is already in the cart: function checkProductInCart($product_id) { global $woocommerce; fo ...

Eliminating Repetition: Preventing Message Duplication in WordPress Database Entries

Whenever I attempt to insert a single post into the database using wp_insert_post(), two posts end up getting added: Ajax request: /wp-admin/admin-ajax.php?action=getchats&chat_type=all-chat&last_msg=110&add_msg=true&chat_message=hellow ...

What is the best way to divide widgets in a Wordpress Sidebar?

I am looking to customize the spacing between widgets in my Wordpress sidebar, similar to what is shown on this example site. Currently, my sidebar does not have the desired spacing. I have tried various CSS codes found online, but none of them seem to be ...

The right alignment with Flexbox's justify content property is not being implemented as expected

I'm having trouble aligning my footer using flexbox - no matter what I try, it won't move all the way to the right. When I use justify-content: center, the items are centered, but when I change it to justify-content: right, everything shifts back to the l ...

Attempting to call a nested div class in JavaScript, but experiencing issues with the updated code when implemented in

Seeking assistance. In the process of creating a nested div inside body > div > div . You can find more information in this Stack Overflow thread. Check out my JSFiddle demo here: https://jsfiddle.net/41w8gjec/6/. You can also view the nested div on the ...

Mastering Jquery Isotope integration with Wordpress for seamless filtering

I've been struggling to implement isotope filtering in my project. As a beginner in jQuery/javascript, I wanted to integrate isotope functionality into a client's website. Despite researching extensively on Stack Overflow and various websites, I ...

Displaying product categories on WooCommerce page for non-registered users

Currently, I am working on a WordPress WooCommerce website and I have encountered an issue. I want to implement a logic where users cannot see product categories, subcategories, or product pages without logging in, and instead be redirected to the login pa ...

Troubleshooting: WordPress post not uploading to custom PHP file - Issue causing ERROR 500

Our website is built using WordPress, and I was tasked with adding a function to our newsletter subscription that sends an email to a specific address based on the selected value in the form. Everything was working perfectly on my local host, but when I tr ...

Can you provide me the steps to delete the title attribute from images in Wordpress?

My client has expressed dissatisfaction with the tooltip that appears when hovering over images in certain browsers, particularly Safari. This tooltip displays the title attribute within the img tag, which is a requirement enforced by Wordpress. Even if w ...

`How to Customize Page Titles and Add Content in WooCommerce`

Currently, I am facing a challenge in adding content after the page title and changing the style of the page where all products are displayed in WooCommerce. Unfortunately, I am unsure about the location of the file that needs to be copied to my custom t ...

Detect and switch the value of a CSS selector using Javascript

Incorporating the subsequent jQuery code to insert CSS styles into a <style id="customizer-preview"> tag within the <head>: wp.customize( 'site_title_color', function( value ) { value.bind( function( newval ) { if ( $( &a ...

Acquiring distinctive taxonomy tags tailored to get_the_ID() (Exterior of loop)

I am facing an issue with a custom taxonomy called "type" and its options: Blog News Training In my project, I have added a draggable element using Visual Composer to display these tags. Unfortunately, the draggable element is not part of the file "arch ...

Calculating shipping fees according to service type, customized delivery preferences, and total number of items in Woocommerce

Can someone assist me with displaying the correct shipping fees on my WordPress and WooCommerce site? I have set my shipping fees as follows: Flat rate (Delivery): $10 Free Shipping (Free Delivery) Local Pickup (Pickup): $0 When a customer goes to check ...

Gathering wp-json custom field data from the Attachment ACF in the Gallery Field

Seeking help with displaying custom field data (attachment) using wp-json in a gallery field within a post. I created custom fields (media_docu_scource) & (media_docu_description) in Attachments, but they are not appearing in the ACF gallery field I creat ...

Utilizing the useSelect hook in Typescript to create custom types for WordPress Gutenberg, specifically targeting the core/editor

As I delve into development with WordPress and the Gutenberg editor, my goal is to incorporate TypeScript into the mix. However, I encounter a type error when trying to utilize the useSelect() hook in conjunction with an associated function from the core/e ...