Hi,
Using the provided wpsl_listing_template and wpsl_more_info filters you can pretty much do anything you want with the appearance of the listings and the “more info” details, where the opening hours typically appear.
Please take a look at the documentation on both filters and get back to us if you need further clarifications 🙂
Regards,
Thread Starter
givver
(@givver)
I was actually looking for a way to hide the hours on an individual listing as some stores don’t have opening hours and some do. I don’t want to turn them all off globally. A toggle button when I create or edit a listing to turn the hours on or off would be the best.
Hello again,
Oh, I see what you mean. Well, unfortunately there is no such option for conditionally disable the hours on an individual listing. As you have probably noticed, there is just a global toggle.
But there is a way you can add a custom toggle yourself for every individual store and then decide whether to show the hours or not in the template based on the value of that additional field. All you have to do is include an additional checkbox metadata field for the stores, and then do something like this in the single-wpsl_store.php template (this is a rough draft of what it could look like):
$show_hours = get_post_meta( $queried_object->ID, 'wpsl_show_hours', true );
if ( $show_hours ) {
echo do_shortcode( '[wpsl_hours]' );
}
Take as reference this article on how to show additional metadata in the store template. Although for it to work you will also need to create the additional metadata in the stores. Follow this article for instructions.
I hope this points you to the right direction.
Regards,