Skip to content

Instantly share code, notes, and snippets.

@bentasm1
Created February 10, 2016 17:02
Show Gist options
  • Select an option

  • Save bentasm1/936a76432d1f22bdbc42 to your computer and use it in GitHub Desktop.

Select an option

Save bentasm1/936a76432d1f22bdbc42 to your computer and use it in GitHub Desktop.
WC Vendors Pro - Sample template for [wcv_vendorslist] shortcode
<?php
// Copy this template to /themes/yourtheme/wc-vendors/front/vendor-list.php
// For more ways to customize this template, visit
// https://www.wcvendors.com/kb/customizing-wcv_vendorslist-for-pro/
// Get vendor store icon and show it as $store_icon, otherwise, show their avatar instead
$icon_id = get_user_meta( $vendor_id, '_wcv_store_icon_id', true );
$store_icon = wp_get_attachment_image_src( $icon_id );
if (isset ($store_icon[0]) ) {
$store_icon = '<img height=200 width=200 src="' . $store_icon[0] . '">';
} else {
$store_icon = get_avatar($vendor_id, 200);
}
?>
<div style="display:inline-block; margin-right:10%;">
<center>
<a href="<?php echo $shop_link; ?>"><?php echo $store_icon; ?></a><br />
<a href="<?php echo $shop_link; ?>" class="button"><?php echo $shop_name; ?></a>
<br /><br />
</center>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment