Modify Listing Listview

This topic contains 5 replies, has 2 voices, and was last updated by  Alex Rollin 1 year, 10 months ago.

  • Author
    Posts
  • #409229

    James Gehring
    Full Member
    Post count: 34

    I am working on modifying the listing-listview.php file. I am trying to add multiple loops and I sort of have it working but if I try to add orderby to the query it returns nothing.

    Here is the top part of my example. If I remove orderby it works. Is there a way to make this work?

      <?php
    				$args = array(
    			'post_type' => 'gd_place',
    			'posts_per_page' => '1',
                            'orderby' => 'rand',
    
    			);
    
    				$query1 = new WP_Query($args);
    
    				if ( $query1->have_posts() ) :
    
    						/**
    						 * Called inside the <code>ul</code> of the listings template, but before any <code>li</code> elements.
    						 *
    						 * When used by the widget view template then it will only show if there are listings to be shown.
    						 *
    						 * @since 1.0.0
    						 * @see 'geodir_after_listing_post_listview'
    						 */
    						do_action('geodir_before_listing_post_listview');
    
    					while ( $query1->have_posts() ) : $query1->the_post();
    
    #409258

    Alex Rollin
    Moderator
    Post count: 21483
    #409395

    James Gehring
    Full Member
    Post count: 34
    This reply has been marked as private.
    #409537

    Alex Rollin
    Moderator
    Post count: 21483

    Hello!

    Have you already tried one of the widgets or shortcodes with sorting options to see if you could get random results near what you are looking for?

    https://wpgeodirectory.com/docs/widgets/
    https://wpgeodirectory.com/docs/core-shortcodes/

    Here in GD support we don’t do customization, focusing instead on bugs and regular improvements that benefit the whole community.

    Would you be interested in having GD experts contact you about implementing your customization request?

    #409558

    James Gehring
    Full Member
    Post count: 34

    Hey, Alex thanks so much for your help. A widget won’t work. I would love to have an expert contact me. What do you need from me to make that happen?

    #409625

    Alex Rollin
    Moderator
    Post count: 21483
    This reply has been marked as private.
Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Modify Listing Listview’ is closed to new replies, this may be for inactivity, please open a new topic if you have a similar question.