How to hide description of gd_listings "nearby places" on details page

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

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

Open Support Ticket
  • Author
    Posts
  • #512347

    awideman
    Expired Member
    Post count: 9

    Is there a way to hide some or all of the elements returned by gd_listings? ie. can the listings use a format that is different from the primary Archive Items layout?

    Here’s what I have right now, but I just want the title, image and rating.

    [gd_listings post_type=”gd_place” related_to=”default_category” sort_by=”distance_asc” layout=”3″ post_limit=”3″ view_all_link=”1″]

    Thanks!

    #512353

    Kor
    Moderator
    Post count: 16516

    Hi awideman,

    Thanks for your post. We can use custom CSS code to hide some elements. Could you share the URL of the page in question?

    #512370

    awideman
    Expired Member
    Post count: 9
    This reply has been marked as private.
    #512384

    Alex Rollin
    Moderator
    Post count: 27815

    The best practice for this is to wrap the items you want to hide in a div inside the GD Archive item.

    Then make sure to wrap that GD Listings in a custom class. In most cases it will get a custom ID, as it does in the page you linked.

    So, this example will hide one element, the address:

    
    
    
    div#geodir_5d9e612754294 .geodir-post-address-container {
        display: none;
    }
    

    But if you wrapped all of the ones you want to hide in a div then you could do the same thing to hide them all like:

    
    
    
    div#geodir_5d9e612754294 .hide-my-custom-div {
        display: none;
    }
    
    #512400

    awideman
    Expired Member
    Post count: 9

    Thanks! It turns out that the div ID changes every time the page loads and is different for every listing (details) page.

    I wrapped the description in the div as you suggested:

    
    <div class="hide-my-custom-div">
    Content to be hidden
    </div>
    

    I was then able to hide description for all grid views by targeting the

      class and then the newly created one:

      
      /*Hiding description in Nearby Places section of Details page*/
      .geodir-gridview .hide-my-custom-div {
      	display: none;
      }
      
    #512498

    Alex Rollin
    Moderator
    Post count: 27815

    Excellent!

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

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

Open Support Ticket