Skip to main content

Questions tagged [wordpress]

WordPress is a free and open source blogging tool and a content-management system (CMS) based on PHP and MySQL.

Filter by
Sorted by
Tagged with
2 votes
0 answers
33 views

I'm working on a custom WordPress plugin that ensures individual-use WooCommerce coupons are properly validated when applied via the admin order editor. By default, WooCommerce only enforces this ...
Pavel Drow's user avatar
3 votes
1 answer
70 views

I work on plugin for custom auth pages for WordPress and I try to create a custom registration form with additional fields. it has a shortcode in Beaver Builder. Is this the correct approach, and ...
Pavel Drow's user avatar
2 votes
0 answers
133 views

I have implemented a custom WooCommerce checkout field to collect a Tax Exempt Number in the billing section. This field's value is stored in the user meta upon checkout to facilitate future orders. ...
intothevoid0's user avatar
1 vote
2 answers
252 views

I've been working on a WordPress pricing page template and would appreciate feedback on the code structure, organization, and any potential improvements. The template is used to display a pricing list ...
KermitTheFrog's user avatar
0 votes
1 answer
322 views

I'm looking for feedback on a WordPress plugin I developed for automatically converting images to WebP and AVIF formats. The goal is to optimize image loading performance. The plugin has the following ...
KermitTheFrog's user avatar
2 votes
1 answer
267 views

I am currently working on my first WordPress plugin. I display custom post types on a google map with pins. The custom post types also have additional information by ACF fields which are displayed in ...
Markus's user avatar
  • 21
0 votes
2 answers
634 views

I'm using SQLite3, via php's extension module, to create a persistent object cache for WordPress. It's intended for use on modestly sized sites that don't have access to redis or memcached. Why use ...
O. Jones's user avatar
  • 329
1 vote
2 answers
155 views

I have a function that has a few and/or operators in it. I'm sure there is a better way to write this but can't seem to figure it out. I thought I could use arrays but ran into an issue with having ...
protagonist's user avatar
1 vote
1 answer
291 views

I'm working with ACF in WP which provides a get_field() function. The function can return an array of values, null or false. ...
mrmadhat's user avatar
  • 168
0 votes
2 answers
153 views

In the posts I have a date field and a start and end date range. I need to query if it matches date or if it matches between the dates in the range. This Query works, but how can I optimize? ...
cRiSs rOcCa's user avatar
4 votes
2 answers
222 views

I've got some code that works as intended, but I have a feeling that it's messy. This code is modifying a wordpress loop and the goal is to check the roles of the current user and show posts of ...
JLW's user avatar
  • 43
2 votes
2 answers
239 views

I am using WP with the Avada theme and the built in Star Rating element as well as ACF Pro. Unfortunately I found out that the Star-Rating element adds a rating scheme to the footer of the website ...
Torsten's user avatar
  • 21
3 votes
2 answers
140 views

I'm learning and want to improve as much as possible. In doing so I have written this custom block that has an image on one side and an inner block on the other. It's using ACF to get the variables ...
Andrew Fair's user avatar
1 vote
1 answer
74 views

the last couple of weeks i have been working on my own WordPress plugin. I am trying to do a class based codebase. My plugin works correctly, but i don't really know if this is the correct way to ...
RowanBlub's user avatar
2 votes
0 answers
48 views

I inserted this code snippet in the functions.php of my child theme, to create the woocommerce single product page in the hook woocommerce_after_single_variation of the custom icons in line centered ...
db151's user avatar
  • 21
1 vote
1 answer
85 views

As the title states, I am building a pre-loader for Wordpress running on PHP 7.3.5+ that will deliver performance boosts in loading, as well as metrics such as Google Page Speed. This is something ...
Bagseye's user avatar
  • 401
3 votes
4 answers
237 views

In my database, I have table wp_postmeta, example: ...
Henrik Petterson's user avatar
0 votes
2 answers
151 views

This code can woocommerce order change status. But as you can see, this code is hard to read. How can I make it cleaner? ...
codescaptain's user avatar
0 votes
2 answers
108 views

I have WP Query like this: ...
Olsz4k's user avatar
  • 3
2 votes
0 answers
56 views

I converted an old Wordpress Plugin of mine from jQuery to plain JavaScript using a cheat sheet. I was very surprised that it seems to work right out of the box on my first try. ...
Marc's user avatar
  • 121
3 votes
1 answer
77 views

This is one of my first attempts at querying the WordPress database for data, and some my first PHP code ever, so please bear that in mind when commenting. It is supposed find data between two dates, ...
ddk's user avatar
  • 31
4 votes
1 answer
119 views

I just started to use WordPress to start building a website, but as I need to use the get_header() function to retrieve the ...
maneroto's user avatar
2 votes
0 answers
35 views

I have a slow query on a wordpress site. How can I rewrite this to make it faster? I'm not having much luck. The query takes about 0.900 seconds I have both the query and the explain below, my goal is ...
JLT's user avatar
  • 21
3 votes
2 answers
174 views

I'm developing a fully AJAX community WP theme that comes with a lot of custom queries. Everything is fine, there is no bug but recently but I had a few clients that have a huge database and my theme ...
techn9ne's user avatar
1 vote
2 answers
445 views

I used the Bootstrap v4.0.0 accordion to display my business services. Further, I created a custom post type "service" for my services (Each service is a post). To display my services ...
dicomp's user avatar
  • 41
4 votes
1 answer
147 views

Is it better to validate and put an array value into a variable at the top of a file or to check the array value directly right before output in the file? I work at a WordPress shop and we have a ...
Tanner Mann's user avatar
5 votes
1 answer
146 views

I have the following code, which displays the content for my custom page template "landingpage.php" and for single posts. The site uses Bootstrap 4. ...
Sniffles's user avatar
1 vote
2 answers
205 views

I'm pretty new to php coding, but i know wordpress for a long time. Also experimenting with bootstrap. I created a new Page Template and modified it a bit. What I'm looking for is to optimize this php ...
Sniffles's user avatar
2 votes
2 answers
100 views

I've created a function that generates an <ul> of my wordpress custom taxonomy terms, displaying ...
James's user avatar
  • 195
2 votes
1 answer
88 views

I am using the following code within the footer of my test site. I am using WordPress and Advanced Custom Fields The intention is: To display the HTML container ...
Bagseye's user avatar
  • 401
3 votes
1 answer
89 views

I have written the following Plugin, which adds fields to the Media/Attachment Entries and returns all information in one Shortcode. This solution works, however, is pretty slow the more entries ...
Max Hartwig's user avatar
4 votes
1 answer
51 views

I am in the process of setting up WordPress with WooCommerce, one of the requirements is a bit of integration that takes a person from another website directly to a specific product. I have set the ...
Eval Knievel's user avatar
2 votes
1 answer
699 views

I'm just use the add_filter('the_content', function($content){}); for filtering anchor tags in a post. Basically, I want filter anchor tags to appropriate format. ...
Engkus Kusnadi's user avatar
1 vote
1 answer
73 views

I made a simple code to improve the results for WordPress related posts area and it works fine , but because my experience in coding is low , my code is very long and i believe that there is a way to ...
sammax's user avatar
  • 43
3 votes
1 answer
86 views

Below are the two things I'm trying to solve, logically. This is just a proof of concept; and I'm not implementing this on real data nor via full plugin at this time. Just looking at logic and syntax ...
Lieutenant Dan's user avatar
3 votes
0 answers
520 views

Plugin is a small editor that allows to create a filter such as a price slider, checkboxes of "brands", a drop-down of "seasons". An example of how plugin work can be seen on page: http://demo-...
Alex Vasilyev's user avatar
2 votes
1 answer
746 views

I had the need to prefix the price for certain product categories on only the shop page (because the price can be higher depending on extras that the customer might want). These were my requirements ...
rpm192's user avatar
  • 153
3 votes
1 answer
78 views

I have a website that, based on a user's comments, filters comments by "most liked first, most disliked first" etc... I have a custom table for comments scoring system and system working with +1 and -...
techn9ne's user avatar
2 votes
0 answers
169 views

I'd like to use basic auth with the WordPress API, but restrict the capability to a single IP address. I've updated the existing code from here: https://github.com/WP-API/Basic-Auth accordingly. It ...
nzt's user avatar
  • 121
1 vote
2 answers
787 views

I've creating a working subscription workflow for my webpage, which heavily utilizes a set of functions I've created for this purpose. However, after doing some testing (functionality works fine), I'...
ok34332's user avatar
  • 21
1 vote
1 answer
84 views

The following code works fine, however, I'm trying to simplify it. I wrote it but I'm a beginner PHP coder. I can see that most probably the use of a function or class would be better... or anything ...
Wasteland's user avatar
  • 537
2 votes
0 answers
313 views

I wrote this code about one year ago. I'm looking to refactor it to be solid SOLID and secure, as this is being generated off a custom endpoint. The script is to read parameters from a query and ...
Dan's user avatar
  • 183
1 vote
1 answer
167 views

I am trying to create a custom WordPress/WooCommerce function in PHP. I am a newbie and would really appreciate some feedback on my code and how to improve the code! Right now it feels like there is a ...
TobiasM's user avatar
  • 113
2 votes
0 answers
40 views

I completed this WordPress coding task as part of an interview. I'm hoping someone can review my work and comment on everything, especially my general approach to the task, and the sanitization of ...
cag8f's user avatar
  • 121
3 votes
3 answers
335 views

I'm looking for improvement / advice / reviews on how I can improve this code. I feel like there is a better way or more efficient way of doing this and I am over looking it. The Plugin I made is ...
Second2None's user avatar
2 votes
0 answers
52 views

I am writing a WordPress plugin that allows shipping calculation on the product page. Originally, shipping calculation is only available in the cart. To calculate shipping costs on product page, ...
Lucas Bustamante's user avatar
0 votes
1 answer
214 views

I'm working on a site running woocommerce and wp where the user will add/has added a dimension attribute. The dimension string will take the following format originally: Ht: 30 1⁄2" W: 22 1⁄2" D: ...
mrmadhat's user avatar
  • 168
4 votes
1 answer
696 views

I have the following front-end code for a responsive navigation menu which I thought using in my WordPress website. Clicking the .burger element should cause ...
user avatar
3 votes
1 answer
167 views

I wrote PHP code to display a Woocommerce notice - "free shipping for $40 & under" only once on shop page and once on cart page, but also in cart should not be more than 40$. The code works, but ...
Dima Vizelka's user avatar
1 vote
2 answers
83 views

This is my code to chmod all .htaccess files under all website dirs under public_html dir. The reason I use this code is to make sure WordPress plugins won't "...
Arcticooling's user avatar