This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Method -1 | |
$args = array( | |
'hide_empty' => 0, //Show me all the categories, even the empty ones | |
'orderby' => 'count', //which accepts a string. You can pick from the following options: ID to order the categories by their ID (no, really?), name to sort them alphabetically (the default value), slug to sort them in the alphabetical order of their slugs, and count to order by the number of posts they contain. | |
'order' => 'DESC', //The chosen order can be reversed by setting DESC (descending) as a value for the order option (by default this option is set to ASC (ascending)). | |
'include' => '15,16,9' | |
); | |
wp_list_categories($args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'the_title', 'shorten_woo_product_title', 10, 2 ); | |
function shorten_woo_product_title( $title, $id ) { | |
if ( ! is_singular( array( 'product' ) ) && get_post_type( $id ) === 'product' ) { | |
return wp_trim_words( $title, 3, '...' ); // change last number to the number of words you want | |
} else { | |
return $title; | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Method-1 | |
Add this line to your theme function.php | |
/ remove product category and tag from single product page | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 ); | |
Method-2 | |
Add these css to your style.css file | |
.single-product .product_meta { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$product_tags = get_terms( 'product_tag'); | |
$i=0; | |
foreach ( $product_tags as $product_tag ) { | |
$args = array( | |
'posts_per_page' => -1, | |
'tax_query' => array( | |
'relation' => 'AND', | |
array( | |
'taxonomy' => 'product_tag', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// These are actions you can unhook/remove! | |
add_action( 'woocommerce_before_single_product', 'wc_print_notices', 10 ); | |
add_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_sale_flash', 10 ); | |
add_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 ); | |
add_action( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 ); | |
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
run this command | |
php -S 127.0.0.1:9000 -t public/ | |
now test to your browser. | |
after this run | |
php artisan serve | |
hope it will works fine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.site-header { | |
position: fixed; | |
top: 0; | |
width: 100%; | |
z-index: 2000; | |
} | |
body .site-inner { | |
top: 77px; | |
} | |
body { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul class="products"> | |
<?php | |
$args = array( 'post_type' => 'product', 'posts_per_page' => 1, 'product_cat' => 'shoes', 'orderby' => 'rand' ); | |
$loop = new WP_Query( $args ); | |
while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?> | |
<h2>Shoes</h2> | |
<li class="product"> | |
<a href="<?php echo get_permalink( $loop->post->ID ) ?>" title="<?php echo esc_attr($loop->post->post_title ? $loop->post->post_title : $loop->post->ID); ?>"> | |
<?php woocommerce_show_product_sale_flash( $post, $product ); ?> | |
<?php if (has_post_thumbnail( $loop->post->ID )) echo get_the_post_thumbnail($loop->post->ID, 'shop_catalog'); else echo '<img src="'.woocommerce_placeholder_img_src().'" alt="Placeholder" width="300px" height="300px" />'; ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="row"> | |
<?php | |
$args = array( 'post_type' => 'product', 'posts_per_page' => 8, 'product_cat' => 'Leather', 'orderby' => 'title','order' => 'ASC', ); | |
$loop = new WP_Query( $args ); | |
while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.widget li > ul, .widget li > ol{ | |
display: none; | |
} |