Shortcode for a single vendor

would be possible to have a shortcode for a single vendor?
I want to create my own page for the vendor, and just insert all listings that belong to him, ideally via shortcode.


Unfortunately, there’s no way to re-create the vendor page separately from HivePress, so there’s no shortcode. Still, you can fully customize it if you add a custom template in HivePress/Templates. Here’s an example of customizing the Listings page Overview | HivePress Templates - YouTube

Thanks for the reply.

This doesn’t allow me to adjust a page for a single vendor, does it? I see the option to pick a vendor page, but there is no block for a single vendor, only vendors block and vendors search.

You could use a wp_query shortcode to get a vendor post type and it’s custom fields like here php - How to make a shortcode for my WP_Query Loop? - Stack Overflow

It’s possible to override a single vendor page template; please follow these instructions How to customize templates - HivePress Help Center. Once the editor refreshes, the template-specific blocks will appear in the Templates block category.

I’ll try to explain better then. Yes, it’s possible to replace any template, as you mentioned before. However, when I want to replace the Vendor template (single vendor) there is no HivePress block available to replicate the original template, eg a block for all listing of a single vendor.

@mennobouma - thanks, I’ll take a look.

I think you need a WP Query which loads all listings that have the same parent id custom field ‘123’ (vendor id). The parent id could be a field in your shortcode.

Please, try using the Listings block from the HivePress block category then. It will automatically detect the surrounding query and show the vendor’s listings.

@yana This actually works, the listing block depends on Template. I thought the block shows default listing no matter the template.

I’ll have to experiment with Wp query to get the vendor listing on a custom page, any help with the snippet appreciated.

1 Like

Unfortunately there’s no easy way if you mean adding this outside the Templates, on custom pages in WordPress/Pages only the default blocks are available (e.g. Listings, Vendors, Categories).

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.