Get Store Logo

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Viewing 1 reply thread
  • Author
    Posts
    • #124603
      andero.avastu
      Participant

      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; ?>

    • #124657
      Sushobhan
      Keymaster

      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!

Viewing 1 reply thread
  • You must be logged in to reply to this topic.