Tagged: ,

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #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,

    #1352381

    Hey 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,
    Ismael

    #1352786

    Hi 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,

    #1352787
    This reply has been marked as private.
    #1353031

    Hi 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

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.