Disable Sidebar in the Product Page in Storefront Theme [closed]

for product page, you can put in functions.php function remove_storefront_sidebar() { if ( is_product() ) { remove_action( ‘storefront_sidebar’, ‘storefront_get_sidebar’, 10 ); } } add_action( ‘get_header’, ‘remove_storefront_sidebar’ ); It works with latest woocommerce 2.5.2 Also CSS is needed: .single-product.right-sidebar .content-area { float: none; margin-right: 0; width: 100%; }

Creating loop within functions.php

Just loop over WP_Query::$posts to get the titles: $option_posts = new WP_Query( [ ‘post_type’ => ‘organisationer’ ] ); $options = []; foreach ( $option_posts->posts as $post ) { $key = “option_{$post->ID}”; $options[ $key ] = apply_filters( ‘the_title’, $post->post_title ); } woocommerce_form_field_radio( ‘custom_field’, array( /* … */ ‘options’ => $options ), $checkout->get_value( ‘custom_field’ ) ); I’m … Read more

display woocommerce all category title on home page

<?php $post_type=”product”; $taxonomies = get_object_taxonomies((object) array( ‘post_type’ => $post_type )); foreach ($taxonomies as $taxonomy) : $terms = get_terms($taxonomy); foreach ($terms as $term) : $term_link = get_term_link($term->term_id); $posts = new WP_Query( “taxonomy=$taxonomy&term=$term->slug&posts_per_page=2″ ); ?> <li> <h2> <a href=”https://wordpress.stackexchange.com/questions/218036/<?php echo $term_link; ?>”><?php echo $term->name; ?></a> </h2> <?php if( $posts->have_posts() ): while( $posts->have_posts() ) : $posts->the_post(); ?> <div> … Read more

Editing Header Titles of each details in woocommerce Order Email [closed]

To change the heading that appears in the body (message) of the email template you can use the following filter: ‘woocommerce_email_heading_’ . $this->id where $this->id equates to the id class property that is set within the email class of the specified type. For example, to change the heading of the “New Order” email you would … Read more

Cannot update WordPress General Settings Site Title and Tagline

Can you check your wp-config.php and double check that you are using the correct database, as if you have changed the values within the wp_options table then they should definitely be reflected in the settings in the back-end of WordPress, whereas, updating from WordPress might not have been saving etc. Sounds like a strange issue … Read more

WooCommerce: display text instead of raw checkbox value email

Try this instead: add_action( “woocommerce_email_after_order_table”, “my_woocommerce_email_after_order_table”, 10, 1); function my_woocommerce_email_after_order_table( $order ) { $my_gift_wrap_checkbox = get_post_meta( $order->id, “my_gift_wrap_checkbox”, true ); $gift_wrap = $my_gift_wrap_checkbox ? ‘Yes please!’ : ‘No thank you.’; echo ‘<p><strong>Gift wrap?: </strong>’ . $gift_wrap . ‘</p>’; if ( $my_gift_wrap_checkbox ) { echo ‘<p><strong>Gift wrap instructions: </strong>’ . get_post_meta( $order->id, “my_gift_wrap_field”, true ) . … Read more

Custom Redirect after registration in WooCommerce

Internally, WooCommerce uses WordPress’ wp_safe_redirect() which does not allow redirects to external hosts. In order to get around this, we must add our desired host to the whitelist. The whitelist can be modified using the allowed_redirect_hosts which has been demonstrated below: /** * Adds example.com to the list of allowed hosts when redirecting using wp_safe_redirect() … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)