Questions tagged [wordpress]
This tag is for programming-specific questions about the WordPress content management system. Off-topic questions include those about theme development, WordPress administration, management best practices, server configuration, etc. These are best asked on the dedicated WordPress Development Stack Exchange site (https://wordpress.stackexchange.com).
for some reason the emails being sent to customers after they create a WooCommerce account displays a random name (see attached).
WooCommerce username error
I think because users can create an account ...
I wanted to get the post thumbnail from the main site while currently in subsite.
Here's my code:
switch_to_blog(1); // main site.
$url = get_the_post_thumbnail_url( $post_id );
restore_current_blog();...
How to redirect number of no-exist pages using 301 redirects in htaaccess,
Options +SymLinksIfOwnerMatch
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !-d
&...
I have set the permalinks for the posts to /%category%/%postname%/.
But the issue is, for the URL where the post name is right but the category name is wrong, it still shows the post instead of ...
I want to prepare a quiz on my wordpress site. I got a code. This code works everywhere but not in my wordpress post. Please can you help with this
<form>
<fieldset>
<legend&...
I need to insert a shortcode [ajaxdomainchecker] into an existing html code.
I tried the following code but it shows error.
Would you please let me know how to add the shortcode?
I'm a newbie, any ...
I am designing my marquee with cursor control in my custom theme wordpress. my goal is to style my marquee into archives looks. can anyone help me how I put style inside my marquee? I tried so many ...
I have a background image that's hues rotate using a css animation. When clicking to a new page on my website that has the same background image it starts again from the first hue, is there a way that ...
i've write this code for sending a cpt with metadata from python to wordpress, it`s one of 4 diffent scenario that i have prove, practicaly i need to send a post with some meta field from python to ...
I need to insert the following custom php code inside the existing HTML code (under the p tag).
Would you please let me know how to add it?
I'm a newbie, any comments would be a big help.
PHP code:
$...
I have a WordPress website and it supports LaTeX code via the LaTeX plugin (Simple Mathjax). When I use code like $\vec{V}$ it responds very well in the WordPress editor and prints my LaTeX code.
But ...
I need to implement a shortcode (domain checker) in a acf field.
So that users can check a domain on frontend.
I tried the following code but it shows a text [ajaxdomainchecker] in the textarea, ...
Basically, I want to mirgrate a list of users with a pw that is hashed with pbkdf2-sha256 to a cms which uses phpass.
In order to accomplish this I try to check the entered pw by the user and generate ...
I'm working on a site right now that requires a list of contacts broken up into departments. I've created a custom post type (team_members) with custom taxonomy (team_category), which contains ...
I am beginner in wordpress and I use the sparkling theme for my website.
I want to display my posts in blog page in 2 or 3 columns, but I don't know how. Currently, my blogs are displayed in a full ...
For some reason my .php file is showing the </div> tag in red.
<div class="self-center tab__number p-12 xl:text-18 font-semibold
">
@if( $tab_counter < 10 ){{0}}@endif{...
My goal
I'm trying to create a custom shortcode for Wordpress and to integrate it with WPBakery. I need such shortcode to wrap any WPBakery element inside an <a> HTML element and to manage it ...
Our website has this random line of code at the top of our website. No matter which page you go to, it's always there. I'm not sure how to remove it/if I should. I believe it's from a plugin that a ...
I'm trying to write a function which adds the currency the customer paid for the online order to the customer's order notes in woocommerce. The function I've written looks like this:
add_action( '...
After migrating all the files in the public_html folder which i get from Hostgator to AWS Lightsail (bitnami wordpress pre-installed), even I still can login into /wp-admin with the old user name and ...
On several moments users get a 500 internal server error after switching a language. It seems that the .htaccess will be overwritten every time with a . /nl/index.php [L] directory.
I contacted the ...
I'm trying to create a post filter in WordPress, using three buttons, one should show all posts, the other two should select posts based on a meta_query. However, when the 'all' button is clicked, ...
I am using WordPress plugin Taxonomy images. I'm using it to get images for taxonomies.
From the below code I am getting the images and link. I want to get category name with these images. Here is my ...
I'm creating custom buttons (rather than the default select dropdown) for my WooCommerce site.
To do this, I've cloned the file for a single-product page into my theme. This file is called variable....
asked 11 hours ago
Freddy
1,62722 gold badges1313 silver badges4444 bronze badges
I'm looking for how to show products from their brand category.
My ULR is in the format www.mywebsite/brand1 or www.mywebsite/brand2 ...
My JS script with the Regex allows me to get brand1 or brand2, ...
I have a product page at /products/[slug].js
and I use Incremental Static Generation for a wordpress/graphql site:
export async function getStaticProps(context) {
const {params: { slug }} = ...
I have to combine two tables on users search in wordpress: I need to add to normal search results the results from another table.
I have tested:
function get_extra_users($query) {
$query =...
I'm using AJAX to filter posts by category, which is working fine. But when I try to add another filter to filter by a custom field called album date my original category filter doesn't work. Each ...
I'm trying to load some functions only on WooCommerce pages.
I've done that
if ( is_woocommerce() || is_cart() || is_checkout() || is_account_page() ) {
require get_template_directory() . '...
asked 13 hours ago
user3334919
5111 gold badge11 silver badge99 bronze badges
I am trying to install the wordpress plugin in my localhost wordpress. I am getting the following error whenever I try to install a new plugin.
Installation failed: Could not create directory.
I am trying to add a custom field and a static value to all of my variable products in Woocommerce. I have gone through other questions but they relate to creating whole new variations. I just need to ...
I'm currently trying to move out of wordpress but before doing so, I must convert my API from $wpdb to PDO
But it seems I can't run PDO in Wordpress since I get this
{"outcome": false, "...
Im trying to update wp_options table with a new url and the command just wont work.
UPDATE TABLE wp_options
SET option_value = "http://34.66.147.230"
WHERE option_name = "siteurl"...
I am having a problem in activating the coming soon page made with the Seedprod plugin, I ended up changing the wordpress site url from general settings and my website and the wordpress editor got ...
Please tell me how to display a list of posts to which the same category is assigned in the WordPress admin part of a custom category? I used this code, but it's work wrong
// Show posts for some ...
I try to get the names of the pages in a loop.
In the widget, the page titles are displayed correctly, but the values are not saved.
How I can save the checked inputs?
Below Full Widget Code:
class ...
I am trying to add analytics to a site built in Wordpress with Elementor. Our web designer built a mega nav that uses pictures and buttons and our leadership team wants to track clicks on the nav. My ...
Looking for some help with using Wordpress behind a reverse proxy. Got two issues.
The setup is like this.
We host the Wordpress site at: www.myblog.com
The Wordpress version is 5.6.4.
The client ...
Just looking at the WordPress sample config file and it includes a comment block starting with:
/**#@+
With a similar comment after the code block:
/**#@-*/
Full context:
/**#@+
* Authentication ...
asked 16 hours ago
BadHorsie
13.1k2727 gold badges106106 silver badges175175 bronze badges
I had the next code, days ago worked perfeclly but 3 days ago not work, return "Else".
<?php
require('../wp-load.php');
if ( is_user_logged_in() ) {
global $current_user;
...
I am creating a child theme for a website as it was never created before by the previous web designer. Whenever I create the child theme and activate it, some of the styling disappears or gets messed ...
I have a wordpress site migrated to azure recently, I have transferred all the media to azure blob storage and changed URLs in the database. I am using WPBakery Page Builder plugin to build the site. ...
How can we separate Wordpress backend and frontend using .htaacess when we are using JS frameworks like ReactJS or Svelekit?
Our website address is : https://www.example.com .
Backend address is : ...
So I know it's not possible to grab the screen width using PHP, but I wanted to see what would be the cleanest way that I can "Check breakpoints" and then pass in the appropriate call?
So I ...
asked 17 hours ago
DevSem
42211 silver badge88 bronze badges
I am using wordpress on mac and I did a migration to a new macbook, since then I have been having loads of problems with file permision and ownership.
First I was having the:
'Upload folder is not ...
asked 17 hours ago
Álvaro
90444 silver badges1414 bronze badges
I was trying to make my Url Seo friendly after I attach my page keyword to my Url in the premier link section, I came across this.
I try to fix it by going back and removing the keyword that I attach ...
I am new with linux and VPS servers in general but I am now learning through building a website that runs in VPS server. Everything else goes smoothly but when I am trying to access my site from my ...
I've installed WordPress, along with the LAMP stack, from the Ubuntu repositories using apt-get, however now I want to add a second site to my server. I know how to add a second WordPress site using ...
Can someone please help me?
I have this code:
function jwa_get_top_dino_users( $post ){
global $wpdb;
$post_id = $post->ID;
$results = $wpdb->get_results( "SELECT * FROM " . ...
On my WordPress web site I want to change the search input value after AJAX response.
After the RESPONSE when I right click inspect element the value of input is changed, but in the browser the ...