On my vendors page (reallygrape.com/explore-by-winery), one of the vendors shows the number of listings they have in the footer of the block. The other vendor doesn’t show the count even though they have 3 published listings.
Hi,
Please disable third-party plugins and customizations (if there are any) and check if this issue persists. If you use a caching plugin, make sure that caching is disabled for logged-in users.
I am not using a caching plugin and deactivating third party plugins didn’t work.
I am trying to add the listing count in manually using this function here:
add_action(
'hivepress/v1/models/vendor/update',
function( $vendor_id, $vendor ) {
$listing_number = $vendor->get_count();
},
10,
2
);
//Add Number of Listings to Vendoe Block
add_filter('hivepress/v1/templates/vendor_view_block', function($template) {
return hivepress()->helper->merge_trees( $template, [
'blocks' => [
'vendor_container' => [
'blocks' => [
'vendor_footer' => [
'blocks' => [
'test' => [
'type' => 'content',
'content' => '<p class="host-count">'.$listing_number.'</p>',
'area' => 'view_block_primary',
'_order' => 10,
]
]
]
]
]
]
]);
}, 1000,
2);
I am successfully adding the new block, but my variable $listing_number isn’t working. It’s showing up blank.
Hi,
Please send temporary WP access to support@hivepress.io with details for reproducing this issue, and we’ll check it (please send only the link, without login and password). You can create a temporary access link using this plugin Temporary Login Without Password – WordPress plugin | WordPress.org.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.