-
AuthorPosts
-
May 19, 2022 at 7:19 pm #1352354
Hello! Thanks for such an awesome theme team Kriesi.
I need to add a Price value and a ‘read more’ Button underneath the title of a Masonry to make it clear that it’s a product which can be purchased.
I’ve tried this post from a few years back but it doesn’t add a button just the words “Read more”. I need something that looks and works as a button.
Is it possible do you think?
Many thanks in advance,
May 20, 2022 at 7:18 am #1352381Hey Ben,
Thank you for the inquiry.
The following filter should render a read more text plus the product price below the masonry content.
add_filter("avf_masonry_entry_content", function($content, $entry, $atts) { $id = $entry->ID; if( get_post_type( $id ) == "product" ) { $product = wc_get_product( $id ); $content .= "<span class='av-masonry-product-price'>" . $product->get_regular_price() . "</span>"; $content .= "<span class='av-masonry-read-more'>Read more</span>"; } return $content; }, 10, 3);
but it doesn’t add a button just the words “Read more”.
You can manually adjust the style of the read more text and make it look like a button with css.
#top .av-masonry-read-more { background: burlywood; border-radius: 3px; padding: 9px 13px; }
Best regards,
IsmaelMay 24, 2022 at 4:54 pm #1352786Hi Ismael, thanks for the reply.
Unfortunately, your suggestion will not work because we’re not using WooCommerce, I’m using Portfolio items instead.
Look forward to hearing you.
Many thanks in advance,
May 24, 2022 at 5:04 pm #1352787This reply has been marked as private.May 26, 2022 at 9:37 am #1353031Hi Ben,
We could add the buy and read more button to the masonry items and make them look like buttons but they won’t be functional in a way because the masonry item itself is already a link. So when you click the buy button or the read more text, it will just redirect to the actual portfolio item page.
It is possible with a custom script but unfortunately, adding this feature will take significant amount of the time and is beyond the scope of support. You may need to hire a freelance developer or contact our partner, Codeable.
Thank you for your understanding.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.