939 reputation
718
bio website visztpeter.me
location
age
visits member for 3 years, 10 months
seen yesterday

Jul
1
comment How to remove a product from an order id WooCommerce?
wc_delete_order_item should work fine, just make sure to use the order item ID, not the item ID
Jun
30
comment taxonomy query on front page
Just to make sure... Do you have a page called Dogs, and a child page Poodles?
Jun
30
comment How to check if a product is purchased within the last 365 days before displaying something
No need, thanks for following my blog:)
Jun
29
comment How to check if a product is purchased within the last 365 days before displaying something
Hi! I updated the code, the issue was in this line: ` $customer_bought = $item['product_id']; ` and should be replaced with $customer_bought[] = $item['product_id']; The rest of the code is fine:)
Jun
26
comment Show different content in the same URL
I don't think its a good SEO idea to change the content of the same url daily.
Jun
25
comment update GST value in woocommerce
Tell me if i'm wrong, but isn't GST is some kind of a tax which is calculated by WooCommerce based on Settings / Tax options? So you can edit your rates there to update the GST amount.
Jun
23
comment Order By Multiple Meta Fields
Yep, sorry, i understand your question now. You can pass an array into orderby in WP_Query to specify a fallback order if the default one wont work. I updated the code. Not sure if this would work for you, i tried it with a couple of posts but obviously i can't replicate the exact stuff you're trying to do.
Jun
14
comment Have I been hacked? Mysterious code at the top of theme files
Yep! Remove the malicious code, update your WordPress, Plugins, Theme, change your admin passwords, change database/ftp passwords, change the salts in wp-config.php, install WordFence and scan your site for more issues.
Jun
14
comment WP AJAX is not working, always returns 0
Add add_action('wp_ajax_nopriv_setAsyncCheckProduct', [$this, 'setAsyncCheckProduct']); too inside assignAsyncEvents()
Jun
12
comment Get the ID of the latest post
get_posts("post_type=yourcpt&numberposts=1&fields=ids") to only return the post id, nothing else, a little bit faster this way:)
Nov
22
comment upload images on front by user using form
See my updated answer. The only issue is with the media library folder. I think if the user will see the wordpress uploader modal window, its fine, we just need to find a way to hide the media library tab, so they don't have access to the already uploaded photos. I'm currently looking into this, i'll post an update if i found something.
Nov
6
comment Elegant way to signify inheritance and relationship between posts
If i understand your question correctly, the 2 segments are a part if the complete show and you can only access the complete show from the frontend right? When you click on it, on the same page it will show the 2 additional segments. So if this is the case then you really don't need to create new posts for the segments.
Nov
6
comment Retrieve featured image as object
Well, usually you only need 1 size. You can use Advanced Custom Fields with the image field which will retrieve a full array with all sizes, but if you place the function i wrote inside your functions.php, its not that complicated.
Nov
6
comment Elegant way to signify inheritance and relationship between posts
I think its much easier to use custom fields to store the segments. The best plugin to use is Advanced Custom Fields PRO(or buy the separate Repeater addon), or you can use the free alternative called Simple Fields and look for also the repeater function.
Nov
4
comment How can add posts without category into category
You can rename the Uncategorized category to News?
Oct
28
comment Order get_users() by last login date. Is it possible?
Thanks, answer updated.
Jul
6
comment Posts to expire (deleted) after a date
How many coupons do you have? it should't be too slow, since its only going to run once a day.
Jul
6
comment Populate custom field on publish or update
in your theme's functions.php file
Jul
6
comment Posts to expire (deleted) after a date
Oh boy...:) You need some experience with WordPress to do something like this. But the code goes inside your theme's function.php file or create a plugin for it. How and where do you registered the coupon post type for the Coupons?
Jul
6
comment Posts to expire (deleted) after a date
The 3 example you showed in the question will work with strtotime, but its not fool-proof. The problem is that 01/12/2014 could be december 1. or january 12, nobody knows 100% sure.