- This topic has 5 replies, 3 voices, and was last updated 3 years, 9 months ago by
David.
-
AuthorPosts
-
July 3, 2017 at 3:05 am #343304
Jamal
Hi
I will repost my question here in the hope someone can help me figure this out.
How can i move the product price on category page to right after the title and before product description? Right now i have it like below
woocommerce-loop-product__title
woocommerce-product-details__short-description
priceThanks
Agressively support the kind of work you want to see. Buy it. Talk about it. Review it.
GeneratePress 1.3.48GP Premium 1.3.1July 3, 2017 at 3:10 am #343306Jamal
Just to clarify more i will be most happy if i can make it look like on the single product
Agressively support the kind of work you want to see. Buy it. Talk about it. Review it.
July 3, 2017 at 6:28 am #343379David
StaffCustomer SupportHi Jamal – maybe this might help. What i wanted was a trimmed short description, so i hid the default short description and hooked in my trimmed description below the price. You could do the same thing.
/* Adding excerpt to shop page */ add_action( 'woocommerce_after_shop_loop_item', 'diggs_custom_shop_item', 5); function diggs_custom_shop_item() { global $post; /* product excerpt */ if ( $post->post_excerpt ) { echo '<div class="diggs-shop-excerpt">' . apply_filters( 'woocommerce_short_description', wp_trim_words($post->post_excerpt,6,' ') ) . '</div>'; } }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/July 3, 2017 at 10:32 am #343512Tom
Lead DeveloperLead DeveloperHi Jamal,
Try this:
add_action( 'after_setup_theme', 'tu_move_wc_price' ); function tu_move_wc_price() { remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 ); add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 1 ); }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJuly 3, 2017 at 2:14 pm #343636Jamal
Thanks David and Tom. I used Tom’s snippet and it works great. Wonderful stuff !
Agressively support the kind of work you want to see. Buy it. Talk about it. Review it.
July 3, 2017 at 2:21 pm #343642David
StaffCustomer SupportNo problem Jamal and thanks Tom – this and the other link Jamal provided regarding hooks has been extremely handy. In the meantime i have just finished crafting 3 shortcodes that allow me to position excerpt, description and price anywhere on the page. They work great in Tom’s new headers – i have full screen featured images in the header with title, price etc……
Tom i expect to see these turn up in the header template tags…..Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.