Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › Add vendor articles to store tab
- This topic has 8 replies, 3 voices, and was last updated 4 years, 10 months ago by
Sarmistha Chakraborty.
- AuthorPosts
- April 27, 2020 at 10:56 am #123545
Kay
ParticipantHi, I will like to display vendor articles and events on the store tab on vendors’ page.
How to do this please?
- April 27, 2020 at 11:07 am #123551
Auhouse.ru
Participant+
- April 27, 2020 at 2:41 pm #123620
Sarmistha Chakraborty
MemberHello,
To display vendor articles in vendor store page,
Add this code in your theme’s functions.phpadd_filter( 'wcfmmp_store_tabs', 'new_wcfmmp_store_tabs',90,2); function new_wcfmmp_store_tabs($store_tabs, $id) { $store_tabs['articles'] = __( 'Articles', 'wc-multivendor-marketplace' ); return $store_tabs; } add_action('wcfmmp_store_article_template','store_article_html'); function store_article_html() { $article_id = get_the_ID(); ?> <a href="<?php echo esc_url(get_permalink($article_id)); ?>"><?php echo esc_attr(get_the_title()); ?></a> <?php }
To modify the article view You can override the article template ,from wp-content\plugins\wc-multivendor-marketplace\views\store\wcfmmp-view-store-articles.php
Override at – child theme\wcfm\store\wcfmmp-view-store-articles.phpRegarding vendor event in vendor store page, Can you let us know which plugin/theme are you using for event in your site?
Thanks.
- April 27, 2020 at 9:05 pm #123787
Kay
ParticipantThanks for the snippet.
Regarding vendor event in vendor store page, Can you let us know which plugin/theme are you using for event in your site?
I use fooevents plugin with Martfury theme.
- April 27, 2020 at 10:00 pm #123804
Sarmistha Chakraborty
MemberHi,
Ok.
This is not possible using code snippet.
It requires serious custom development.
Please contact us here –https://wclovers.com/setup-guidance/ with topic link.Thank You
- April 27, 2020 at 3:09 pm #123631
Auhouse.ru
ParticipantAdded code, how to make this bunch of text more beautiful and with pictures?
Attachments:
You must be logged in to view attached files. - April 27, 2020 at 3:32 pm #123643
Sarmistha Chakraborty
MemberHello,
You have write own HTML structure as per your requirement how to display the articles. To show images modify this code
add_action('wcfmmp_store_article_template','store_article_html'); function store_article_html() { $article_id = get_the_ID(); $src = wp_get_attachment_image_src( get_post_thumbnail_id($article_id), 'thumbnail' ); $url = $src[0]; ?> <!-- Add your own HTML--> <div style="display: inline-block;"> <img src="<?php echo $url;?>" alt="<?php echo esc_attr(get_the_title()); ?>" /> <p><a href="<?php echo esc_url(get_permalink($article_id)); ?>"><?php echo esc_attr(get_the_title()); ?></a></p> </div> <?php }
Thanks.
- April 27, 2020 at 3:41 pm #123646
Auhouse.ru
ParticipantIt turned out like this, now align the mesh as it should
Attachments:
You must be logged in to view attached files. - April 27, 2020 at 8:51 pm #123780
Sarmistha Chakraborty
MemberHello,
As mentioned earlier we have provided you the code which will display the articles in a “article” tab.
But now you have to structured and design (write code in HTML and css) the each article as per your requirement to be displayed.
If you asking us to designed the template as per your requirement, then this is not possible using code snippet.
It requires serious custom development.
If you are interested then please contact us here –https://wclovers.com/setup-guidance/Thanks
- AuthorPosts
- You must be logged in to reply to this topic.