Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WC Vendors › Get Store Logo
- This topic has 1 reply, 2 voices, and was last updated 4 years, 6 months ago by Sushobhan.
Viewing 1 reply thread
- AuthorPosts
- April 29, 2020 at 3:53 pm #124603andero.avastuParticipant
Hello, I am trying to put the Store logo on a Article that is made by the user what should I use in the PHP code to get it, I´ve tried so many solutions.
What should I include etc?This is on the store view file, but it doesn’t work since my PHP file isn’t in the plugin folder
<?php echo $gravatar; ?> - April 29, 2020 at 5:45 pm #124657SushobhanKeymaster
Hi,
Thanks for getting in touch with us!
You can use this shortcode or use only the shop logo fetching logic as per your needs-add_shortcode( 'store_logo_on_article', function() { if ( is_single() ) { $author_id = get_post_field( 'post_author' ); if ( wcfm_is_vendor( $author_id ) ) { $store_user = wcfmmp_get_store( $author_id ); $shop_url = $store_user->get_shop_url(); $shop_logo = $store_user->get_avatar(); echo '<a class="wcfm_store_logo_icon" href="' . $shop_url . '" target="_blank"><img src="' . $shop_logo . '" alt="Store Logo" /></a>'; } } } );
Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/
Let me know how this goes.
Thanks!
- AuthorPosts
Viewing 1 reply thread
- You must be logged in to reply to this topic.