Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #338271

    Hi,

    I have a taxonomy called “Shop Vendor” (it’s a WooCommerce Extension http://www.woothemes.com/products/product-vendors/) allowing to attach one or more WooCommerce products to a Vendor.

    I’d like to use your Masonry Entries shortcode to display the Shop Vendors and not the products attached.

    Is it possible to do that ?

    I put the shortcode masonry_entries.php in the /shortcodes folder of my child theme. But honestly I can’t find which query I need to modify to achieve my goal.

    Thanks for your help!

    #339293

    Hey Basile!

    Do you see the “Shop Vendor” taxonomy in the dropdown here?

    Best regards,
    Josue

    #339388

    Yes I see the Shop Vendor taxonomy and when I select it I can see the Taxonomy Terms.

    But It only displays the products attached to Taxonomy Terms not the Termes themselves…

    Thanks for your help.

    • This reply was modified 10 years, 2 months ago by basilefanon.
    #339498

    Hi!

    We use the WP_Query Class to get the content to show in the masonry element, as far as i know there is no way to fetch Taxonomies instead of Posts/Pages/Products/etc.

    Best regards,
    Josue

    #339984

    Thx for your feedback but I don’t understand, how you’re able to display the terms in the second dropdown as soon as I select the Shop Vendor taxonomy but on the frontend side, it’s not possible to achieve such thing ?

    Thanks in advance for your help!

    #340263

    Hi!

    That’s a different functionality. Correct me if i am wrong, but you want to show the Terms as the masonry content, instead of the Posts attached to that Term?

    Cheers!
    Josue

    #340289

    Exactly. :)

    Pleaaaaase tell me it’s possible.

    #340306

    Problem is that a Term (or a Taxonomy) it’s not a suitable element for WP Query fetching, it is meant to be used for categorization of the content rather than being the content (it lacks of featured images and other meta data like tags, published date, etc).

    Do you have an example of what you want to achieve? perhaps there is more WordPress-reliant approach we can think of.

    Regards,
    Josue

    #340643

    Thanks Josue,

    To be precise, I want to create a shortcode to display my list of vendor on my site. So far, I’ve been able to create this :

    add_shortcode( 'list_vendors', 'wc_list_vendors_shortcode' );
    
    function wc_list_vendors_shortcode( $atts ) {
        $vendors = '';
        $terms = get_terms( 'shop_vendor', array( 'hide_empty' => false ) );
        foreach ( $terms as $term ) {
            $term_link = get_term_link( $term, 'shop_vendor' );
    		$logo = get_field('logo', $term);
    		if ( is_wp_error( $term_link ) )
    			continue;
    		$logo_ids .= $logo['id'] . ",";
        }
        $vendors .= do_shortcode("[av_masonry_gallery ids='" . $logo_ids . "' items='24' columns='flexible' paginate='pagination' size='flex' gap='large' overlay_fx='active' caption_elements='title excerpt' caption_display='always' container_links='active' id='']");
    
        return $vendors;
    }

    But I can’t apply a link to my image leading to my vendor page. It’s possible if I create the shortcode straight from the post editor but I can do it on the fly, do I ?

    Thanks for your help!

    #342571

    Hey!

    The custom link is a meta data (“av-custom-link”) attached to the media file, in this case i think you’d need to do that with the term in question, check out /enfold/config-templatebuilder/avia-template-builder/php/media.class.php:87.

    Cheers!
    Josue

    #342787

    Thanks Josue for your feedback.

    How can I modify it in my Child Theme ?

    I copy the file somewhere in my child theme folder or only the function into my functions.php ?

    Thanks for your help.

    #344370

    Hi!

    Actually i’m not sure if that would work because i don’t know how are you setting the meta data for these terms (ACF?). I think the answer resides in /config-templatebuilder/avia-shortcodes/masonry_entries.php:771 instead:

    $custom_url = get_post_meta( $id, 'av-custom-link', true );
    

    Cheers!
    Josue

    #350197

    Thx for your answer… So that mean that masonry_entries.php also works with av-custom-link ?

    Thx

    #350215

    Yes, try changing that to a hard-coded value to see if that changes something in your custom masonry:

    $custom_url = "http://kriesi.at";
    

    Regards,
    Josue

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