wordpress

Adding Webp support to Revolution Slider

不想你离开。 提交于 2021-02-10 14:51:46
问题 I want Revolution Slider to use webp images if there is any available but it has no support for webp. How can i make this work ? 回答1: Open /wp-content/plugins/revslider/includes/output.class.php in a text editor. Search for if($img_size !== 'full' && $cur_img_id !== false && !empty($cur_img_id)){ $_urlImage = wp_get_attachment_image_src($cur_img_id, $img_size); $urlImage = ($_urlImage !== false) ? $_urlImage[0] : $urlImage; } inside the function get_html_layer() . Add if ( !empty($urlImage) &

Sorting order items via a hooked function in WooCommerce

…衆ロ難τιáo~ 提交于 2021-02-10 14:42:04
问题 In WooCommerce, I have a product attribute pa_location for "location" with which I sort my order items. When order items have the same location, I'd like to sort them by SKU. So, sort first by location and then by SKU. I looked to "PHP usort sorting multiple fields" but I am unable to figure out how it applies and would work for my function. I have this custom function that works to sort by pa_location , but cannot get it to also sort by _sku . I tried implementing some of the examples in the

Display the product attribute term for the selected variation in Woocommerce

痴心易碎 提交于 2021-02-10 14:41:24
问题 In Woocommerce, I use the following code to get the product attribute terms. function action_woocommerce_product_meta_end() { global $product; $term_ids = wp_get_post_terms( $product->get_id(), 'pa_apple-id', array('fields' => 'ids') ); echo get_the_term_list( $product->get_id(), 'pa_apple-id', '<span class="posted_in">' . _n( 'Vendor:', 'Vendors:', count( $term_ids ), 'woocommerce' ) . ' ', ', ', '</span>' ); } add_action( 'woocommerce_product_meta_end', 'action_woocommerce_product_meta_end'

Sorting order items via a hooked function in WooCommerce

守給你的承諾、 提交于 2021-02-10 14:39:03
问题 In WooCommerce, I have a product attribute pa_location for "location" with which I sort my order items. When order items have the same location, I'd like to sort them by SKU. So, sort first by location and then by SKU. I looked to "PHP usort sorting multiple fields" but I am unable to figure out how it applies and would work for my function. I have this custom function that works to sort by pa_location , but cannot get it to also sort by _sku . I tried implementing some of the examples in the

Get specific product attribute name and value for each WooCommerce variation of a variable product

我的梦境 提交于 2021-02-10 14:36:39
问题 In WooCommerce, I would like to display variable products with my own custom design as a carousel of product variations. I got the code by which I can display the regular price of the product in array but I stuck in getting attribute name and value in that. Based on "WooCommerce variable products: Display some variations values in an HTML table" answer code, here is my actual code: add_action( 'woocommerce_before_single_product_summary', 'custom_table_after_single_product' ); function custom

Change specific shipping method title on WooCommerce orders after checkout

不羁岁月 提交于 2021-02-10 14:35:27
问题 I have some custom fields in my shipping information that is not being displayed "properly" in the shipping information of orders under woocommerce -> orders -> order#. The cart and checkout pages are different via php code that changes a label. The cart image1 is the original\core label that is defined in shipping methods image2, this is being sent to the order information page. I would like the checkout information to show instead which is shown in image3. Image4 is how it currently looks

How Execute PHP File Using a Cron Job

混江龙づ霸主 提交于 2021-02-10 14:29:40
问题 I am using a WordPress site hosted on a DigitalOcean WordPress Litespeed droplet. I am attempting to run a php file in my theme every five minutes using a Cron Job. I don't want to use the default WordPress cron job system. So far I have connected to the sever through ssh. Then entered the crontab using "crontab -e" then entered the following code then saved / exit */5 * * * * php /var/www/html/wp-content/themes/my_theme/cron.php And inside the cron.php I put a simple mailing function for

How to prevent `out of stock` items to show as a filter option in the sidebar (layered nav widget ) in WooCommerce?

泄露秘密 提交于 2021-02-10 14:19:41
问题 I have 'hide out of stock' checked in the settings, however when using the layered navigation widget to filter results by shoe size, it is returning products which have that size listed as an attribute, but the size is out of stock. Is there a fix to this? WordPress version 3.9.1, WooCommerce version 2.1.7 http://www.foten.se 回答1: He means not showing the products in the filter results. If a user filters by size M, he wants to see available size M products in the results, not All products

Add a custom field to an order in WooCommerce 3+

十年热恋 提交于 2021-02-10 14:18:02
问题 In WooCommerce, I would like to add a new custom field to order details. I now that I can use use the code below to create a new custom field 'referenceNumber' and adds in it "ordercreated" value: update_post_meta($order_id, 'referenceNumber', 'ordercreated']); What I would like is to make that through checkout once an order is placed. But it doesn't work it doesn't add a new custom field to order details page and don't add the value 'ordercreated', as you can see in this screenshot: So the

Access running docker container filesystem

纵饮孤独 提交于 2021-02-10 14:17:18
问题 I am developing a WordPress theme and set up the development environment using docker. My docker-compose.yml volume property looks like this; volumes: - ~/WordPress/wp-content:/var/www/html/wp-content it mounts just the wp-content directory to the local machine. I now have to edit wp-config file which is in /var/www/html/ the docker image container. Can anyone here show me how to access and edit the wp-config file in the running docker container? 回答1: You can run a shell terminal in the