Order of listing results
This topic contains 7 replies, has 2 voices, and was last updated by Simone 10 years, 10 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
June 12, 2015 at 6:23 am #42326
Hi, currently order of listing results looks like its displaying by date of creation. Can we change this to alphabetical by default?
Thanks.
June 12, 2015 at 12:29 pm #42346Hi, are you talking about the Popular post view widget? In that case, there is a sorting by AZ.
You can also play in the post type settings, in the Sorting option, you can add Title and made it the default sorting (asc/desc)June 17, 2015 at 6:47 am #42834Hi Simone,
Im just talking about regular listings in the category listings pages. Eg. view all hotels, or all places, etc.
Your second suggestion there would work except that then it over rides the Featured listings being listed first, which is of course important.
Is there a way to do this on a global scale so it effects all CPT’s at once?
Thanks, Bodhi
June 17, 2015 at 11:50 am #42846Hi, so in the Listing page.. Some time ago I wrote a code to add a content section in that page so you can drag a widget, in your case a widget for the featured listings, and below you will have the other listings sorted by A-Z, will it work? Following you’ll find the code, add it in the functions.php file inside your child theme’s folder and then you will find a new widget area GD Listing Content Section
function listing_content_init() { register_sidebar( array( 'name' => 'GD Listing Content Section ', 'id' => 'listing_content', 'before_widget' => '<div>', 'after_widget' => '</div>', 'before_title' => '<h2">', 'after_title' => '</h2>', ) ); } add_action( 'widgets_init', 'listing_content_init' ); add_action( 'geodir_main_content_open', 'geodir_listings_map_before', 10 ); function geodir_listings_map_before() { ?> <?php if ( is_active_sidebar( 'listing_content' ) ) : ?> <div> <?php dynamic_sidebar( 'listing_content' ); ?> </div>June 19, 2015 at 7:15 pm #43111Hi Simone, i think that will likely work for us but i keep getting a syntax error when i put that into the site.
I copied and pasted exactly what you have there. Its saying unepexted } or unexpected ending depending where i place your code.
Thank you, almost there.
June 19, 2015 at 7:24 pm #43114Sorry, I copied it impartially, there you go
function listing_content_init() { register_sidebar( array( 'name' => 'GD Listing Content Section ', 'id' => 'listing_content', 'before_widget' => '<div>', 'after_widget' => '</div>', 'before_title' => '<h2">', 'after_title' => '</h2>', ) ); } add_action( 'widgets_init', 'listing_content_init' ); add_action( 'geodir_main_content_open', 'geodir_listings_map_before', 10 ); function geodir_listings_map_before() { ?> <?php if ( is_active_sidebar( 'listing_content' ) ) : ?> <div> <?php dynamic_sidebar( 'listing_content' ); ?> </div> <?php endif; }June 19, 2015 at 8:53 pm #43123Hi thanks, the updated code worked. However, i cant find a widget that allows me to show the current cpt featured posts. They all seem to make you choose a CPT. because this will be effecting multiple cpt’s it would need to be relevant to the CPT currently in view.
Is this possible?
B
June 19, 2015 at 9:55 pm #43125Hmmm….I think this is not possible
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket