Favorite listings layout

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

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

Open Support Ticket
  • Author
    Posts
  • #495677

    evocativemedia
    Expired Member
    Post count: 28

    How can I change the layout of user’s favorite listings? I would like to display just 2 columns by default and remove the loop actions..

    #495703

    Alex Rollin
    Moderator
    Post count: 27815

    If you are referring to the default author dashboards produced by GD or UsersWP that would require a customization.

    If you are displaying them with the GD Listings shortcode you can adjust the layout with the options in the shortcode builder.

    https://wpgeodirectory.com/docs-v2/geodirectory/shortcode-builder/

    #495712

    evocativemedia
    Expired Member
    Post count: 28

    In the attachment you can see what I mean. Is there a hook I can use for setting a default column setup there? In that case I can simply hide the loop actions with css..

    #495737

    Alex Rollin
    Moderator
    Post count: 27815

    Sorry, I’m not getting it. Please share a link to the page.

    #495769

    evocativemedia
    Expired Member
    Post count: 28
    #495770

    evocativemedia
    Expired Member
    Post count: 28
    This reply has been marked as private.
    #495786

    Alex Rollin
    Moderator
    Post count: 27815
    This reply has been marked as private.
    #495789

    evocativemedia
    Expired Member
    Post count: 28
    This reply has been marked as private.
    #495876

    Naveen Giri
    Moderator
    Post count: 1559

    Hi, You can use following Js code to set grid 2 as default.
    you can place it in theme js file

    jQuery(document).ready(function(){
    	jQuery('.geodir-list-view-select #gd_list_view').val('2').trigger('change');	
    });
    #495884

    evocativemedia
    Expired Member
    Post count: 28

    Thanks, but this doesn’t work. It changes the select value but not the layout.

    #495908

    Naveen Giri
    Moderator
    Post count: 1559

    Hi @evocativemedia,
    right now it seems working to me.
    have you done anything, do you still need help?

    #495960

    evocativemedia
    Expired Member
    Post count: 28

    Hmm it doesn’t work here. I have added 2 screenshot:
    Screenshot 1 (I selected all text): you can see that grid 2 is selected, however the layout still remains as list.
    Screenshot 2: this is how the layout looks when i manually select grid 2.

    #496011

    Naveen Giri
    Moderator
    Post count: 1559

    Hi @evocativemedia,

    Please try this updated code.

        jQuery(document).ready(function(){
            jQuery('.geodir-list-view-select #gd_list_view').val('2').trigger('change');    
            $noStore = false;
            geodir_list_view_select(jQuery('#gd_list_view[name="gd_list_view"]'), $noStore);
        });
    #496020

    evocativemedia
    Expired Member
    Post count: 28

    Yes that’s it! Thank you!

    #496102

    evocativemedia
    Expired Member
    Post count: 28

    I can recommend to put the function contents in a wrapper to check for existence of the respective selectors, otherwise an error is given for ‘geodir_list_view_select()’. Hence:

    
    jQuery(document).ready(function(){
       if (jquery(".geodir-list-view-select #gd_list_view")[0]){
          ...
       }
    });
    
Viewing 15 posts - 1 through 15 (of 15 total)

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

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount