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.

A method for utilizing a read-only script in WordPress to target two distinct forms

I stumbled upon this code snippet that can make a field read-only on a form in WordPress. However, I'm facing difficulty implementing it for two different forms: // modify '1' to match the ID of your first form add_filter( 'gform_pre_render_1', 'add_readon ...

Show unique field data characteristics encoded in multidimensional arrays in WordPress

Looking to showcase a custom field meta_key value from WordPress. The information is stored as a custom field meta_key value in WordPress $data = get_post_meta( get_the_ID(), 'data', false); print_r($data); Array ( [0] => [ { "title":&quo ...

Creating a two-column post loop in Wordpress is a great way to display content in a

I've been attempting to separate posts for a long time without success. No matter what variations I try, the result is always either a single post or duplicating all of them. In other words, multiple posts are not displaying as intended. If anyone has a s ...

Child Theme setup in progress! Beware of the error message: "Unable to access file: file_get_contents9(). The specified stream does not exist."

I am currently in the process of developing a child theme based on my existing theme (Tesseract 2). I have carefully followed the guidelines outlined here, but unfortunately, I keep encountering the following error: Warning: file_get_contents(/home/fletch ...

What is the best method for preserving theme/plugin/php modifications in WordPress?

After researching php file editing and scripts on various platforms, including WordPress related sites, I find myself feeling a bit overwhelmed and confused. I have some clarification questions that I hope to get answered: 1. Is it safe and advisable to c ...

Hide the border on a table with CSS

I recently installed a Wordpress Template and customized the table's background and text colors. However, I am struggling to remove the border around the table. Despite searching for solutions, my limited CSS knowledge has not led me to a fix that works fo ...

What steps can I take to prevent automatic redirection when submitting an input on an AJAX form in PHP?

I have encountered a strange issue with my HTML post loading dynamically inside a modal popup. I noticed that when I submit the form directly in the post, it works fine but doesn't work inside the modal :/ Every time I try to submit the form from the ...

Issue with flash installation

I'm currently working on a WordPress website at www.studium.cl. However, I've encountered an issue when trying to open it in Internet Explorer. Each time I try to access the site, a window pops up prompting me to install Adobe Flash Player. Even after I i ...

Customizing the WordPress loop with different arguments for an alternate outcome

I want to display posts from a custom post type that have the category 'pin-post-to-homepage'. If there are no posts with this category, then I would like to show posts from a different post type. Below are the arguments. I believe I am very close to achi ...

Issue with Wordpress Custom Post Type Category Functionality

I've successfully created a custom post type named "Blog" by adding the following code to my theme's functions.php file: function create_posttype() { register_post_type( 'blog', array( 'labels' => array( 'name' => __( 'Blog' ), ...

Customize the number of posts displayed on your WordPress homepage to create a unique

I recently started a new Wordpress blog and initially set the default number of posts per page to 6. However, I now want to change it so that only 4 posts are displayed on my homepage. I attempted to create a custom page template for this purpose, but I ...

Wordpress: nginx encountered an error

I set up my wordpress website on DigitalOcean, following a tutorial from this site. The next day, my wordpress site went down and I encountered the following error message: "An unexpected error has occurred. Apologies, but the page you are trying to acc ...

Unexpected Results from WordPress Ajax Request

Currently, I am utilizing the snippets plugin in conjunction with Elementor. To implement an ajax function as a snippet, I have set it up like so: add_action( 'wp_ajax_get_slug_from_id', 'get_slug_from_id' ); add_action( 'wp_ajax_nopriv_get_slug_from_id', ...

When attempting to upload a PDF or DOC file to WordPress media using a subscriber role, an error is encountered

Recently, I started using BuddyPress Docs and encountered an issue when trying to upload files from my front-end website. Image uploads were successful with a subscriber role, but I faced errors when attempting to upload .PDF or .xlsx files. I received ...

Integrating a PHP function within an ECHO statement

Here is a code snippet I'm currently using in my Wordpress: function wpstudio_doctype() { $content = '<!DOCTYPE html>' . " "; $content .= '<html ' . language_attributes() . '>'; echo apply_filters( 'wpstudio_doctype', $content ); } H ...

Guide to integrating custom fields in Wordpress with mapbox-gl js to generate map markers

Currently, I am in the process of generating a map that will display various points using Mapbox and WordPress. To achieve this, I have set up a custom post type within WordPress where the coordinates are stored in custom meta fields. Although the fields h ...

Creating a WordPress post popup using Ajax with SimpleModal and jQuery

I tried to follow the instructions provided in this tutorial but unfortunately, I couldn't get it to work. This is the process I followed: 1 / Including in the header <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">& ...

How can I effectively display personalized information from an MSAccess database on a WordPress website?

I am seeking advice from experienced Wordpress developers. My organization possesses an internal MS Access database that comprises various tables, reports, and input forms. The structure of the database is relatively straightforward, encompassing informati ...

Creating a simple bootstrap code for developing plugins in Wordpress

After successfully coding in Brackets with the Theseus plugin on my local machine, I encountered a problem when attempting to transfer my code to a Wordpress installation. The transition from Brackets to Wordpress seems far more complicated than expected. ...

Is there a way to showcase the value of this.state in save.js?

I'm currently exploring React and have a question regarding displaying the values of this.state in my WordPress frontend. Specifically, I am working on save.js. In edit.js: import apiFetch from '@wordpress/api-fetch'; const { Component } = ...

Hide the div if the content is empty

Within a div created by the_content, there may be content or it could be null, resulting in an empty div that I want to hide. To address this issue, I attempted to store the content in variable $pageContent. However, upon declaring the variable, it either ...

Error 500 in WordPress Child Theme due to AJAX Internal Issue

I have encountered an issue with my Ajax code in the Js/Jq block (/buscador/menuLateral/menu-libros.php): $.ajax({ url: '<?= get_stylesheet_directory_uri(); ?>' + '/buscador/buscador-functions.php', type: 'POST', data: { sendCheckedVal ...

Encountered a PHP Fatal error stating that the class 'Memcache' was not found in the object-cache.php file of WordPress, despite having successfully installed the memcache extension

I attempted to activate object cache for my Wordpress site using Memcache. I added the object-cache.php file to the /wp-content/ directory, obtained from the Memcached Object Cache plugin. However, I encountered a PHP Fatal error: Class 'Memcache' not fou ...

Troubleshooting error in WordPress: Changing innerHTML of dynamically created divs using JavaScript. Issue: 'Unable to set property innerHTMl of null'

I am struggling to modify the innerHTML of a "View cart" button using a dynamically generated div class on my Wordpress/Woocommerce site. In a previous inquiry, I was informed (thanks to Mike :) ) that since JavaScript is an onload event, the class changes ...

What is the process for setting up a node http proxy directed towards a specific subfolder on Bluehost

Check out my blog! This is the script I'm running: var httpProxy = require('http-proxy'); var apiProxy = httpProxy.createProxyServer(); app.get("/blog/", function(req, res){ apiProxy.web(req, res, { target: 'http://69.195.124.88/~crowdfoo/blogbeac ...

Error: Unable to Locate CSS File for Wordpress Elementor

Currently in the process of transferring a WordPress website that utilizes Elementor. Successfully migrated both the code and database over. However, upon inspecting the page, I encountered a 404 error indicating that a css file associated with Elementor c ...

ajax clock encounters net::ERR_INSUFFICIENT_RESOURCES error

I recently set up an ajax php clock, but I keep encountering numerous net::ERR_INSUFFICIENT_RESOURCES errors in my console. Can anyone shed some light on why this might be happening? Below is the code responsible for calling out the clock function: $(docu ...

Protecting REST API token in a JavaScript XMLHttpRequest call

I am in the process of integrating a 3rd-party REST API with my WordPress page for a search app functionality. I want to ensure that data is fetched using AJAX without having to refresh the page. Here is how the API setup works: To obtain a bearer token, ...

It appears that the jQuery script is not loading properly

For my wordpress site, I have integrated jQuery using the wp_enqueue_script function along with the jQZoom script. In the header of my site, you can find the following lines in this order: <link rel='stylesheet' id='jQZoom_style-css' href='http://mys ...

What is the process for updating the image credit in WordPress?

Is there a way to modify the image author (uploaded by) within the WordPress media library? https://i.stack.imgur.com/zvgfu.jpg ...

Limit jQuery script to operate exclusively on a single page

Despite the abundance of answers to similar questions, my lack of JS skills hinders me from implementing them in my specific case. On my WordPress site, I have a script that changes the navigation bar's color when scrolling down to the #startchange CS ...

utilize jQuery to load webpage with an HTML dropdown element

Querying the Campaigns: // Getting the campaigns $campaigns = $wpdb->get_results( "SELECT * FROM tbl_campaigns ORDER BY campaignID DESC", OBJECT_K ); // Displaying the Cam ...

Eliminate the use of backslashes in JSON responses when using the WordPress REST API

As I work on extending the Wordpress Rest API, I encounter backslashes even after adding json flags to eliminate them. Below is what I am attempting: stripslashes(json_encode(['success'=> true], JSON_FORCE_OBJECT | JSON_HEX_APOS)); The outpu ...

In order to enable automatic playback of background images

Having created a slider with hover functionality on icons to change background images, I now seek to add an autoplay feature to the slider. The slider was implemented in a WordPress project using Elementor and involved custom Slider creation through JavaSc ...

Guide to displaying WordPress functions within an accordion in my loop

Currently, I'm working on implementing a vertical accordion feature that will display blog posts within each section. The idea is to have 5 of the most recent posts displayed in the accordion, with each post showing the date (day/month/year) and title. To ...

Switch the secondary menu to be the main menu on all pages excluding the homepage in WordPress

I am looking to customize my menu display by showing the primary menu only on my home page (front-page.php) and displaying the secondary menu on all other pages except for the home page. In my functions.php file, I have registered both the primary and sec ...

Custom taxonomies are not appearing in the WordPress Admin column for a specific custom post type

I have developed a customized post type known as protocols and added several taxonomies to enable users to filter/search through the list of posts. However, for some reason, the taxonomy categories are not appearing on the admin screen's post list for ...

Using a separate function to trigger the save_post action for custom posts in Wordpress

I have created a custom post using functions.php, which is working fine in the admin panel. Now, I want to manually create a custom post from another PHP file using AJAX. Here is the code snippet from functions.php: add_action('save_post', &apos ...

Common Errors with PHP Includes

Following the migration of a WordPress site from a development server to the live site, I am encountering the following issues: A cautionary message is being displayed: include() [function.include]: Failed opening '/home/content/83/11353583/html/wp-conten ...

Encountering a "400 Bad Request" error when using Ajax within WordPress

I've been trying to submit a form using Ajax within a plugin. I had two plugins, the first one was initially working but has stopped now and I can't seem to find any errors. I don't think the issue lies in the code itself, but I'm feeling a bit lost. Here ...

Is it possible to insert IE conditionals within functions.php in WordPress?

One common practice is to include the following script in the <head> section specifically for Internet Explorer 9. <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> Wh ...

Implement various class versions tailored specifically for mobile browsers

While editing a Wordpress theme, I decided to include a content box within Bootstrap's <div class="well">. However, I soon encountered an issue where there was excess space in the content box on desktop view. To address this, I removed the padding-bo ...

PHP output restaurant menu items: converting array to JSON format

I'm encountering an issue while trying to display a list of links from my custom navigation in wp_head. Although my code is somewhat functional, the outputted links appear distorted. Expected link: https://example.com/sample-page/ Actual result: / / ...

Utilize npm libraries within the main directory of Sage 8.5.3 theme

When attempting to add npm libraries in the root of Sage 8.5.3, I encountered an error in the console stating that 'require' was not found. var GoogleMapsLoader = require('google-maps'); GoogleMapsLoader.load(function(google) { ...

Gone Without a Trace: Where Did the WP Admin

I am brand new to creating WordPress themes and I have just started working on my very first one. I have managed to get some content up and running, and the home page is functioning properly. However, when I log into WordPress and view the site, I noticed ...

Lines running horizontally on either side of the text

I recently found a helpful solution on Stack Overflow, but it's not exactly what I'm looking for due to two main reasons: I am unsure how to adjust the width of the lines to make them shorter. The solution uses H2, however, I have already d ...

Transfer data accurately from main window to fancybox iframe

Seeking assistance with a Wordpress plugin I've created using PHP. It's a gallery plugin that allows users to add captions and custom fields for images. The forms are displayed in a Fancybox modal, triggered by clicking input buttons. Here is an example o ...

Enhance the appearance of specific wordpress usernames by adding a touch of "flair" next to them

I'm looking to add a special "flair" next to specific users on my WordPress website, similar to how YouTube distinguishes verified users. I have the CSS for changing the color on hover, but I need help keeping it positioned correctly. Examples from YouTub ...

Troubleshooting 404 Errors When Accessing Wordpress Custom Post Type Posts and Categories

I have recently developed multiple custom post types on a WordPress website. The issue I am facing is that while the links are generated correctly in the form of root/category/id/postname, each link to the full post, pagination or category results in a 404 ...

"Enhance Your WordPress Website with the Power of jQuery

I have been developing a unique Wordpress plugin that incorporates a grid loading effect using jQuery. The script I have implemented is as follows: <script type="text/javascript"> new GridScrollFx( document.getElementById( 'grid' ), { viewportFa ...

Conditional display in Woocommerce

I have encountered another issue. I am attempting to perform a category checkup and provide a positive or negative response with my WooCommerce categories. My goal is to exclude the "accessories" category from my shop page, but only include accessories on ...

Issues encountered with integrating external jQuery/JavaScript functions with Wordpress child theme template

After creating a custom template in my WordPress child theme, I added a link to the Bootstrap v3.0.3 .js file stored on my site. While the popup modal is functioning properly, the jQuery tabs seem to be having some issues. Although they are being display ...

When using margin-right and a width of 100% in the WordPress backend, a scrollbar may be triggered

I have been working on developing a configuration page for my WordPress plugin. In order to display the content, I included an <ul> element inside a <div> container and added it to the configuration page. However, I encountered an issue where a ...

The code for implementing the "Read More" feature is not functioning as intended

I have been experiencing an issue with the implementation of the "read more" feature on my website. Although the code seems to be functioning properly, it only works after pressing the read more button twice. This particular code is designed to detect the ...

"Upon using the wordpress get_posts() function, it seems that the_ID()

I am facing an issue when trying to load a list of posts from a specific category using AJAX. Strangely, I am getting the correct number of posts and excerpts for each post, but the ID and title are empty, and the date is showing as 1.1.1970. Below is my f ...

Enhanced Slider Display featuring Multiple Posts for Improved Performance

My Sample Page features a slider that displays over 200 posts, each containing 5 images. However, the slider loads all the images at once, causing my page speed to be very slow. I am looking for an optimized way to display the slider without compromising l ...

What is the best way to track the loading progress of an AJAX page in WordPress?

On my WordPress blog, I utilize a plugin known as Advanced Ajax Page Loader. This handy tool loads the next page or post through AJAX and then places it in a specific div on my site. However, I am now interested in incorporating a progress bar to show the ...

Mastering the art of flawlessly executing kerning-generated code

I am facing a problem while implementing logotext with kerning technique in the <header> element. I found a useful tool made by Mr. Andrew which can be accessed through this link. Before making any modifications, I had the following code in the heade ...

Unique WordPress Loop Design (Grid/Row)

Looking for a custom Wordpress post loop that will display posts in a specific format. The desired layout includes two posts in each "col" div, both contained within a "row" div: <div class="row cols2"> <div class="col left"> <a href="#"> ...

Empty space under the banner in Wordpress theme Avada

I can't seem to locate the CSS class for a blank space that appears below the header on one of my pages. This space is situated between the header and "SERVICIOS 24 HORAS". Any ideas on how I can remove this mysterious gap? My website is built with the ...

Conceal a different CSS class if a certain CSS class is present on the page

I am currently working on organizing my page to distinguish between purchased and unsold products. For the items that have been bought, I am using the CSS class "winning_bid" within a div element. My goal is to hide another div with the class "price" if th ...

Secondary sidebar remains static and is not visible

UPDATE: It's strange that even after commenting out <?php get_footer(); ?>, it still appears... perhaps the initial theme is executing something in the background? Just to clarify, I am utilizing the HTML5 / Starkers boilerplate theme: http://wo ...

Added the .active state to the menu navigation successfully, however the active color was not implemented

My primary navigation menu is managed by WordPress and can be seen below. I aimed to modify the active state when a user clicks on a link in the menu by adding background-color and color for styling purposes. Although changing the background-color upon cl ...

Tips for incorporating custom blocks into page content while utilizing get_the_content() method

Our Wordpress theme has a custom page template that displays the content from 3 different pages in a tabbed layout. One of these tabs includes a glossary section, which looks like: <div class="glossary-content content e8-tab-panel" data-tab=&q ...

What steps should I follow to incorporate WordPress as a subdomain within a Next.js application?

Currently, I am working on a project where I have developed a Next.js (React) application with the backend running on WordPress. The app is live on the Vercel platform and connected to my GoDaddy domain. However, I am encountering an issue when trying to ...

Using Javascript to automatically replace content when the page is loaded

Having trouble with my fullCalendar jquery calendar and the 'eventClick' method. When I click on an event, the URL is getting encoded incorrectly. For example, I'm trying to pass a Wordpress URL like this: http://sitedomain.com/?post_type=events&p=34 ...

WordPress Custom PDF Loading Script: PDF document failed to load

Looking for Assistance: I am in need of a PHP script that can retrieve and load PDF files from a specific directory. For instance, when I visit the URL www.mydomainameweb.com/wp-content/themes/elegant/pdf.php?file=a.pdf (or www.mydomainameweb.com/pdf?file= ...

Wordpress is having issues running jQuery

I've developed a function inside js/custom.js. The purpose of this function is to arrange posts in my Wordpress site by applying a class called articleAlign. This class will enhance the spacing between the article title and its excerpt, but only when ...

Adjust input quantities for product variations in Woocommerce

In my WooCommerce store, I encountered an issue with a variable product that has 3 product variations. Unfortunately, the quantity to sell for each variation needs to be fixed and cannot be adjusted by the customer. For instance: We have 2 Red items ava ...

Looking to display blog entries instead of project listings

I have a theme that supports displaying Portfolio Items on a full-width portfolio Home page. However, these portfolio items do not support videos but I can embed videos in normal posts. What I need to do is change the homepage to display category posts in ...

The WooCommerce mini cart fails to refresh after items are added using AJAX

I have successfully implemented adding multiple items with quantities to the cart using AJAX. However, after adding a product, the mini cart is not updating as expected. I am calling WC_AJAX::get_refreshed_fragments() in my function.php and have a hook set ...

Logging in with the same user across various WordPress websites on separate databases

Need help with coding for a single user login on two separate WordPress domains each using different databases. The sites are: www.site1.com - DB1 www.site2.com - DB2 ...

Tips for organizing the output of wp_query

I'm looking to organize the results of my wp_query, wanting to arrange them by different parameters without needing to run the query again. Here is what I have so far: $the_query = new WP_Query( $args ); I’d like to sort $the_query; WP_Query gives a st ...

Issue: The use of 'ajax' option is restricted for Select2 when connected to an <input> element - Following the update to version 3.1.2

After updating the WooCommerce version to 3.1.2, I encountered an issue while trying to add or edit a variable product. An error message "Uncaught Error: Option 'ajax' is not allowed for Select2 when attached to a element." appears when selecting a product ...

Unable to restrict IP access to wp-login.php on Nginx server

My website is being targeted with attacks on wp-login.php, so I took steps to protect it. Here is the code snippet I used: location ~ ^/(wp-admin|wp-login.php) { allow x.x.x.x; deny all; } While this code successfully protects the wp-admin directory, un ...