New answers tagged php
0
votes
Modify the permalink structure for a specific category
Kofeigen, thank you very much for your help. You were essential for the code corrections. Here is the final code, implementing specific redirection to the 'news' category. When the URL is hacked, it ...
0
votes
Modify the permalink structure for a specific category
A user posted several correction ideas; unfortunately, they were deleted, but I managed to remember some things and apply them to the code. The 404 error no longer appears; now it generates the ...
0
votes
Modify the permalink structure for a specific category
UPDATE
The answer below was temporarily deleted because I noticed that while it works to display the desired post, it also displayed "false positives". If the name query variable is used (...
0
votes
Parse error: syntax error, unexpected token "endif", expecting end of file in C:\xampp\htdocs\Blog\register.php
The code you provided seems to be a part of a PHP script designed to display error messages stored in an array called $errors. However, it appears that the opening tag for the PHP block is incomplete. ...
0
votes
How do I reinit Wordpress plugins dynamically using jS?
Thanks you so much @van for sharing this. I was struggling with this for a while to use a WP Plugin with Barba page transition.
I would also like to share my implementation.
Before you try this, make ...
0
votes
Update Multiple Post Meta for the Same Post In One call?
You can also serialize the array
$metaValues = array(
'key1' => 'value1',
'key2' => 'value2',
// ... as many key/values as you want
);
update_post_meta($postId,'post_meta_name', ...
0
votes
Encountering 400 Bad Request Error When Sending Form Information to API through Elementor
Diane, I've been trying to provide help but I'm not getting answers to my comments from any of your questions. You'll likely get a better response if you add to one question rather than continuing to ...
0
votes
Trouble with WordPress Settings API: Form Submits When Fields Called Directly, Fails When Using Callbacks
Thank you for the responses Tom! You got me on track, I should have checked the rendered html earlier. Here's the answer.
The rendered html was showing hidden inputs, for clarity, I'll just repeat my ...
0
votes
Bring your own theme to PHP 8
I have found the error.
In the header.php an undefined constant was tried to be accessed. So instead of the following wrong code:
<?php if ($pagetitle == pagetitle_1){
$pt1 = "pagetitle_1&...
2
votes
Accepted
Mixed results with is_page() WordPress function, when using $this, or self
You've shared that this is how the member variable is defined:
class PropertySearch {
private static $listing_details_template_name;
This means it is a private static variable and can be accessed ...
0
votes
Inserting custom PHP script on homepage
Yeah, it looks I'm answering myself... But generally I can see this topic was viewed over 3k times so it is still actual. My charts/tables/dashboards are now composed inside existing CSS Wordpress ...
0
votes
global $product is empty string when passed into function
So, I started to rewrite functions by declaring the global $product at the top of my functions.php file,
This is why it stopped working, because the global statement has to be inside the same scope ...
0
votes
Pass a PHP variable to another file
use this to define your global variable
function turn_addons_vars() {
// Your Variable Names
global $kdev_addons, $kdev_addon;
// Set Default your variable Data
$critical_css = '';
...
0
votes
Accepted
Check for a value in a custom query
After some serious thinking and some trial and error I came up with this solution.
Because all data in the query comes from ACF fields I found a way to use the data from these fields to get the result ...
0
votes
Display WooCommerce Order Custom Field In Template (HPOS)
Use $order->get_meta('my_custom_field') instead.
1
vote
Accepted
How can I run a second wp_remote_post() based on the response of the first?
wp_remote_post has a configuration option called blocking. Its description says:
Whether the calling code requires the result of the request.
If set to false, the request will be sent to the remote ...
-2
votes
Remove /category/ from category (archive) page URLs (without using a plugin)
Following these two simple steps, you can successfully remove “/category/” from your WordPress website’s URLs. This not only makes your links look cleaner but also enhances the user experience.
In the ...
Top 50 recent answers are included
Related Tags
php × 10438functions × 1657
plugins × 1200
plugin-development × 761
woocommerce-offtopic × 557
custom-post-types × 506
javascript × 502
ajax × 493
theme-development × 432
loop × 408
posts × 405
wp-query × 401
customization × 390
html × 382
jquery × 381
shortcode × 369
mysql × 367
css × 321
categories × 302
custom-field × 286
database × 265
filters × 226
themes × 221
menus × 213
images × 212