wordpress

Woocommerce - Check if product was created less than 60 days ago

强颜欢笑 提交于 2021-02-20 04:06:36
问题 I want to check if a Woocommerce product was created less than 60 days ago. - If true, do something. I am obtaining the date the product was created in backend/admin using the official Woocmmerce function $product->get_date_created . My code partially works, but it seems to be checking if $product->get_date_created literally contains the value 60 instead of perfoming the calculation and minusing 60 days from the current DateTime . I have come to this conclusion because my IF statement runs

Add image caption under image thumbnail in WooCommerce single product page

霸气de小男生 提交于 2021-02-20 04:06:23
问题 I'm trying to add the image caption under each image thumbnail in WooCommerce single product page. Here you can see where I want the text to be showed (presently "undefined") I want to add the individual caption text (not the product title, the image caption. Each image has a different caption). Is there an easy way to do that? I'm using ToolSet and can add JavaScript snippet if needed. I saw a post that talk about this but can't figure it out where to put that code : Show caption under

Add image caption under image thumbnail in WooCommerce single product page

≯℡__Kan透↙ 提交于 2021-02-20 04:06:07
问题 I'm trying to add the image caption under each image thumbnail in WooCommerce single product page. Here you can see where I want the text to be showed (presently "undefined") I want to add the individual caption text (not the product title, the image caption. Each image has a different caption). Is there an easy way to do that? I'm using ToolSet and can add JavaScript snippet if needed. I saw a post that talk about this but can't figure it out where to put that code : Show caption under

Add image caption under image thumbnail in WooCommerce single product page

[亡魂溺海] 提交于 2021-02-20 04:05:07
问题 I'm trying to add the image caption under each image thumbnail in WooCommerce single product page. Here you can see where I want the text to be showed (presently "undefined") I want to add the individual caption text (not the product title, the image caption. Each image has a different caption). Is there an easy way to do that? I'm using ToolSet and can add JavaScript snippet if needed. I saw a post that talk about this but can't figure it out where to put that code : Show caption under

Call a function with the submit button in HTML

回眸只為那壹抹淺笑 提交于 2021-02-20 03:56:06
问题 I need a Google AdWords conversion script to work whenever someone submits a form for a free quote. Google has provided the script which I'm put into a Snippet with WordPress and activated it for the site. I now need to call that function when the submit button is pressed, but I can't remember the correct syntax and Google searches so far have led me down long paths of .php file creations that isn't answering what feels like a simple solution would solve. Currently I have added the function

Sql query to bulk change roles in Wordpress in the database?

≡放荡痞女 提交于 2021-02-20 02:47:13
问题 Wordpress: I need to bulk change user roles in the database using the "user id". Something like: "Find users with id: 2827, 772, 234, 983, 14999 and set their rol to "custumer" I know that the roles are saved in the table "wp_usermeta" in the fields "meta_key=wp_capabilities" and "meta_value=a:1:{s:6:"editor";b:1;}". But I don't know how to create the slq query to search and replace them to change their values.See capture attached. 回答1: Easiest for me is to use phpmyadmin and edit one record.

Sql query to bulk change roles in Wordpress in the database?

走远了吗. 提交于 2021-02-20 02:46:32
问题 Wordpress: I need to bulk change user roles in the database using the "user id". Something like: "Find users with id: 2827, 772, 234, 983, 14999 and set their rol to "custumer" I know that the roles are saved in the table "wp_usermeta" in the fields "meta_key=wp_capabilities" and "meta_value=a:1:{s:6:"editor";b:1;}". But I don't know how to create the slq query to search and replace them to change their values.See capture attached. 回答1: Easiest for me is to use phpmyadmin and edit one record.

Sql query to bulk change roles in Wordpress in the database?

↘锁芯ラ 提交于 2021-02-20 02:46:11
问题 Wordpress: I need to bulk change user roles in the database using the "user id". Something like: "Find users with id: 2827, 772, 234, 983, 14999 and set their rol to "custumer" I know that the roles are saved in the table "wp_usermeta" in the fields "meta_key=wp_capabilities" and "meta_value=a:1:{s:6:"editor";b:1;}". But I don't know how to create the slq query to search and replace them to change their values.See capture attached. 回答1: Easiest for me is to use phpmyadmin and edit one record.

Using AJAX to load more products WooCommerce

做~自己de王妃 提交于 2021-02-20 00:45:33
问题 I am using AJAX to load more products on a WooCommerce archive. I have used AJAX to "Load More" once before on this page. I have used the same code for the most part, just altered the WP_Query arguments to suit my needs. I can't understand why my code doesn't work. JS /** * AJAX Load (Lazy Load) events */ $('#load-more').click( function(e){ e.preventDefault(); ajax_next_posts() $('body').addClass('ajaxLoading'); }); var ajaxLock = false; // ajaxLock is just a flag to prevent double clicks and

Using AJAX to load more products WooCommerce

别说谁变了你拦得住时间么 提交于 2021-02-20 00:44:34
问题 I am using AJAX to load more products on a WooCommerce archive. I have used AJAX to "Load More" once before on this page. I have used the same code for the most part, just altered the WP_Query arguments to suit my needs. I can't understand why my code doesn't work. JS /** * AJAX Load (Lazy Load) events */ $('#load-more').click( function(e){ e.preventDefault(); ajax_next_posts() $('body').addClass('ajaxLoading'); }); var ajaxLock = false; // ajaxLock is just a flag to prevent double clicks and