Show Featured listing on Category/Archive Page

This topic contains 12 replies, has 2 voices, and was last updated by  mattpram 4 years, 5 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #518639

    mattpram
    Free User
    Post count: 7

    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?

    #518649

    Alex Rollin
    Moderator
    Post count: 27815

    Hello,

    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.

    https://wpgeodirectory.com/docs-v2/places/sorting/

    #518742

    mattpram
    Free User
    Post count: 7

    Alex,
    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!

    #518765

    mattpram
    Free User
    Post count: 7

    Alex,
    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?

    #518809

    Alex Rollin
    Moderator
    Post count: 27815

    Try 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"]
    
    #519553

    mattpram
    Free User
    Post count: 7

    I 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?

    #519564

    Alex Rollin
    Moderator
    Post count: 27815

    Maybe 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.

    #519567

    mattpram
    Free User
    Post count: 7
    This reply has been marked as private.
    #519603

    Alex Rollin
    Moderator
    Post count: 27815

    Try 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"
    #519907

    mattpram
    Free User
    Post count: 7

    No that is what I had originally and it has no effect. It continues to show all featured listings not related to category.

    #519934

    Alex Rollin
    Moderator
    Post count: 27815

    Thanks, I see what you mean. I will get the developers to take a look.

    #519935

    Alex Rollin
    Moderator
    Post count: 27815

    I 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.

    #519939

    mattpram
    Free User
    Post count: 7

    Okay, 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

Viewing 13 posts - 1 through 13 (of 13 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket