wordpress

Additional columns and item values in Woocommerce email order details

爱⌒轻易说出口 提交于 2021-02-18 08:03:24
问题 I am editing a Woocommerce email template but am a little stuck - I need to add a few columns to the order summary table so that it contains: Quantity Product Product code Price VAT I have added the table headers that I need into 'email-order-details.php' (copied to my theme's email folder) to but not sure how to get the actual content into the table. The code from the file is below: <?php /** * Order details table shown in emails. * * This template can be overridden by copying it to

Permission problem: How to setup permissions on docker for windows for use with Wordpress

空扰寡人 提交于 2021-02-18 07:22:11
问题 The problem I'm trying to setup my developing environment using Docker for Windows for use with Wordpress. I'm using docker compose with a custom Dockerfile. This works perfectly on MacOS. Using the exact same docker setup on Windows though gets me these messages within Wordpress. Trying to upload media Trying to update Wordpress Clearly, Worpress doesn't have the correct file permissions. What I tried 1. Checking Docker for Windows settings and upgrading to WSL 2 I'm using the WSL 2 based

Use Wordpress' Excerpt with a “more” link?

若如初见. 提交于 2021-02-18 06:43:25
问题 Wordpress' documentation suggests adding the following to functions.php to enable what I want to do: function new_excerpt_more($post) { return '<a href="'. get_permalink($post->ID) . '">' . 'Read the Rest...' . '</a>'; } add_filter('excerpt_more', 'new_excerpt_more'); As per: http://codex.wordpress.org/Function_Reference/the_excerpt But when I add this to functions.php, and I attempt to use it, I don't see the more link. Here is how I try to use it: the_excerpt(__('(more...)')); I've also

Php post method not getting data from url

吃可爱长大的小学妹 提交于 2021-02-17 06:35:11
问题 I have an URL which is to be used for getting post data after pasting and pressing enter in the browser. My link is : http://vtrails.us/mixtape-builder/?song_urls=http://vtrails.us/wp-content/uploads/2015/12/mpthreetest.mp3&song_artist=ganja <?php if(isset($_POST['song_urls']) && !empty($_POST['song_urls'])){ $song_url = $_POST['song_urls']; $song_artist = $_POST['song_artist']; } echo $song_url; echo $song_artist; ?> But i am not getting any of them.So what can i do now? 回答1: If you use $

Php post method not getting data from url

喜欢而已 提交于 2021-02-17 06:35:07
问题 I have an URL which is to be used for getting post data after pasting and pressing enter in the browser. My link is : http://vtrails.us/mixtape-builder/?song_urls=http://vtrails.us/wp-content/uploads/2015/12/mpthreetest.mp3&song_artist=ganja <?php if(isset($_POST['song_urls']) && !empty($_POST['song_urls'])){ $song_url = $_POST['song_urls']; $song_artist = $_POST['song_artist']; } echo $song_url; echo $song_artist; ?> But i am not getting any of them.So what can i do now? 回答1: If you use $

Make my image full width

大兔子大兔子 提交于 2021-02-17 05:21:06
问题 How do I edit this in my css .container, .navbar-static-top .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container { width: 1170px; } The website is http://insightcxo.com/test-2 I want to make the image full width or 1230px This is the code I have in the editor .page-id-731 .container { width: 1230px; } Thanks! 回答1: Img { width:100%; max-width: 100%; } should work for you. 回答2: I want to make the image full width or 1230px img { min-width: 1230px; } You mean something like

How to Add Confirm Password Field In WooCommerce Registration Page?

我只是一个虾纸丫 提交于 2021-02-17 05:14:45
问题 Am trying to add the code <?php // Add the code below to your theme's functions.php file to add a confirm password field on the register form under My Accounts. add_filter('woocommerce_registration_errors', 'registration_errors_validation', 10,3); function registration_errors_validation($reg_errors, $sanitized_user_login, $user_email) { global $woocommerce; extract( $_POST ); if ( strcmp( $password, $password2 ) !== 0 ) { return new WP_Error( 'registration-error', __( 'Passwords do not match.

Add a product add-on field to specific products on WooCommerce

一个人想着一个人 提交于 2021-02-17 03:22:57
问题 I need to change the code to not display text area on all of my WooCommerce products but only 2, this is on my WordPress child theme under functions.php file. I have changed $product_id to $product_id = 2130 (my specific product id) , not sure if I'm supposed to change all the $product_id or $_POST for this code to display on only 2 products It is for a specific product or products that gets personalized with a name. I have tried changing the code $product_id to numerous other extensions to

Target a specific page template with Timber (WordPress)

霸气de小男生 提交于 2021-02-17 03:19:32
问题 I am trying to output some HTML content on a specific page with a Timber file (.twig). I have been able to output content on the home page but not on a specific page. I tried the following code : % if fn (is_page('proprietes')) %} <h5 class="widget__headline">Test</h5> {% endif %} But I end up with a blank page. I probably made a dump syntax mistake... Thanks for your help. 回答1: Correct way: {% if fn('is_page', page) %} "page" can be slug/id/array of id's etc. 回答2: Try using id instead of

WooCommerce custom report: Get orders with completed status

梦想的初衷 提交于 2021-02-17 02:50:08
问题 im making a custom reports for woocommerce im trying to add a report for all delivered orders here is what im doing $orders = wc_get_orders( array('numberposts' => -1) ); foreach( $orders as $order ){ if ( $order->get_status() === completed){ $order_data = $order->get_data(); // The Order data $items = $order->get_items(); foreach ( $items as $item ) { $product_name = $item->get_name(); $product_id = $item->get_product_id(); } $orders_completed .= '<tr><td>' . $order->get_order_number() . '<