Hook or Filter or any way to get a list of featured listings

This topic contains 4 replies, has 3 voices, and was last updated by  Kiran 4 years, 5 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #519737

    siparker
    Buyer
    Post count: 114

    Hi,

    I am trying to get the id’s of all featured listings from somewhere and im not sure how to do it.

    I have a few options if you can advise which would be your suggested one to use.

    In this example i am using a post carousel to display the listings. it is a WPbakery element. I want to so the same thing with just an image slider and some other elements so it is the facility to get just featured listings that interests me.

    In the options for this element i can specify the post type i want to display and my geodirectory cpt is there. This then displays all of the listings. there is obviously not a limit to featured option as the post carousel doesnt know the capabilities of each CPT.

    I can filter the posts that are shown by tags and categories. however the featured listings again dont have any specific tag or category.

    I can add in a list of id’s to include but this would be a manual process each time a featured listing is added or removed.

    I have a plugin which allows replacement of values within the shortcode. so for example i could replace the list of ID’s to include with the results from a filter output or an action output.

    the other option is for me to just use the gdlisting shortcode with featured only set but this would mean i have to style the output to hide a lot of stuff as they all use the same archive item layout.

    So the question is..

    is there a filter or hook which will return a list of ID’s for featured listings.

    Is there a way to tag listings as featured or add them to a featured category automatically when they become featured and rmeove them when they are removed.

    Is there another smart way to get a list of just featured listings into a wpbakery element in order to display these in different ways.

    Or is there some other output i can use to get the list of featured listings as objects which i can use in an element not specifically designed to be used with GD.

    I know this is quite a tall ask but i really want to show my featured listings throughout my site and make them pretty….

    Thanks in advance for your feedback.

    #519747

    siparker
    Buyer
    Post count: 114

    I found the method to include new options for replacemtns in the plugin we use.

    http://www.custompagetemplates.com/customizing-replacement-options-dynamic-shortcode-values/

    so i can define a new option to replace values with the output of any function. i just need to know what function i would use to get the featured listings ID,s specifically.

    #519753

    Alex Rollin
    Moderator
    Post count: 27815

    I will have the developers take a look at your question.

    #519848

    siparker
    Buyer
    Post count: 114

    Thank you.

    #520252

    Kiran
    Moderator
    Post count: 7069

    Hi,

    You can use following shortcode to show featured listings.

    [gd_listings title='' post_type='gd_place' post_limit='10' add_location_filter=0 sort_by='latest' layout=3 view_all_link=0 show_featured_only=1]

    OR you can use following code to retrieve featured listing object.

    
    
    $query_args = array(
    	'posts_per_page' => 10,
    	'is_geodir_loop' => true,
    	'gd_location' => true,
    	'post_type' => 'gd_place', /* POST TYPE */
    	'order_by' => 'latest',
    	'distance_to_post' => false,
    	'pageno' => 1,
    	'show_featured_only' => true /* SHOW FEATURED ONLY */
    );
    $listings = geodir_get_widget_listings( $query_args );

    Regards,
    Kiran

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

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

Open Support Ticket