Show Featured listing on Category/Archive Page
This topic contains 12 replies, has 2 voices, and was last updated by mattpram 5 years ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: archive page, Featured Listing
-
AuthorPosts
-
November 25, 2019 at 7:31 pm #518639
I am looking to show featured listing with photos at the top of the page in a grid view, and then non-featured listing below in a list view. Can someone point me in the right direction for documentation on how to do that?
November 25, 2019 at 8:03 pm #518649Hello,
the recommended way to do that is with sorting for featured. You can read more about that and other ‘featured’ features here:
https://wpgeodirectory.com/docs-v2/geodirectory/featured-listings/
You should consider using sorting first because it will not show duplicates.
An alternative is to add a GD Listings element to the top of the archive page template, and to set that with the option to ‘Show only featured listings’. However, if you do that, you may see duplicates in the top and bottom, and you may not have enough room to show all the featured listings on your site. Sorting will not create those issues.
November 26, 2019 at 1:17 pm #518742Alex,
Thanks for the suggestions! One of the main reasons we are doing it this way is to have only our featured listings show an image, and all other listings just be a text listing. I understand the concern on not being able to show all of the featured listings. I will investigate more, but you put me in the right direction. Thanks again!November 26, 2019 at 5:05 pm #518765Alex,
So I have it pretty much working the way I want, but I can not seem to figure out how to get the GD Listings shortcode to only output featured listings for the category that I am browsing.Example, if you look at the attached screenshot this is of my category page. Who’s URL is /vendors/category/venues/
In the top featured image area I have
[gd_notifications] [gd_category_description] [gd_listings post_type="gd_place" related_to="category" post_limit="6" show_featured_only="1" sort_by="random" title_tag="h3" layout="3" ]
I thought that the related_to would make it target the category that I am currently browsing, but that does not seem to be the case.
As if I browse to a different category like /vendors/category/transportation/ the same three listings are featured.
Any advice?
November 27, 2019 at 3:12 am #518809Try filter by current post type and leave the categories as they are with all selected.
[gd_listings post_type="gd_place" post_limit="5" show_featured_only="1" use_viewing_post_type="1" sort_by="az" title_tag="h3" layout="1" view_all_link="1" bottom_pagination="1"]
December 2, 2019 at 3:54 pm #519553I tried that and there is still no change. The shortcode seems to be pulling featured lists from ALL categories, not the category that is being viewed.
Any other suggestions?
December 2, 2019 at 4:29 pm #519564Maybe those listings are in the same categories?
Have you considered setting your sorting to show featured first?
https://wpgeodirectory.com/docs-v2/places/sorting/
If we need to take a look please share a link to the page and WP Admin credentials in a private reply.
December 2, 2019 at 4:59 pm #519567This reply has been marked as private.December 2, 2019 at 11:05 pm #519603Try this one, on my test site it filters by category on the archive page, though the feature was originally developed for related listings on the details page.
[gd_listings post_type="gd_place" related_to="category" post_limit="5" use_viewing_post_type="1" sort_by="az" title_tag="h3" layout="1" view_all_link="1" bottom_pagination="1"]
The key param is
related_to="category"
December 4, 2019 at 3:26 pm #519907No that is what I had originally and it has no effect. It continues to show all featured listings not related to category.
December 4, 2019 at 5:05 pm #519934Thanks, I see what you mean. I will get the developers to take a look.
December 4, 2019 at 5:18 pm #519935I spoke with the developers and sorting featured first is the way to get those featured listings to the top.
Otherwise you will need something like widget logic to show a GD Listings -> Attractions on the archive for Attractions category.December 4, 2019 at 5:33 pm #519939Okay, no problem. Thanks for taking the time to investigate for me. I went and wrote quick shortcode which outputs featured listings for category.
In case you have anyone else that wants it they can look at https://gist.github.com/mattpramschufer/deda3eca703142bb3467190d883326bd
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket