Current User Listings Page

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

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

Open Support Ticket
  • Author
    Posts
  • #255662

    Clinton Williams
    Expired Member
    Post count: 34

    I’m attempting to add a “dashboard” page for my users that displays their listings separated by places & events. When I place this shortcode [gd_listings post_author=”current”] it displays all the listings from my site. I’ve followed this thread and attempted everything suggested here but nothing was successful:
    https://wpgeodirectory.com/support/topic/display-users-listings-shortcode/

    Any advice?

    #255694

    Guust
    Moderator
    Post count: 29970

    Is there any reason you are not using the GD Login widget that will automatically create and link to those pages?

    See also
    https://wpgeodirectory.com/docs/core-design/#navigation
    https://wpgeodirectory.com/docs/core-design/#author

    #255867

    Clinton Williams
    Expired Member
    Post count: 34

    Yes. Because I want to consolidate all of their information on one page without multiple links. I’d like to make it as seamless as possible for my clients.

    The login widget is just not functional for my purposes.

    #255965

    Kiran
    Moderator
    Post count: 7069

    Hey Clinton,

    Currently there is not any parameter id ge_listings shortcode that used to retrieve logged user’s listings. but it you can achieve by using following code snippet.

    1) Add shortcode “[gd_place_listings]” to page.
    2) Add following code to your current theme functions.php

    
    
    function gd_place_listings_custom($atts, $content = '') {
        $user_id = (int)get_current_user_id();
        
        return do_shortcode( '[gd_listings post_author="' . $user_id . '" post_type="gd_place" add_location_filter="0" layout="3" post_number="9"]<p>Oops! No places found.</p>[/gd_listings]' );
    }
    add_shortcode('gd_place_listings', 'gd_place_listings_custom');

    Let us know.

    Thanks,
    Kiran

    #257160

    Clinton Williams
    Expired Member
    Post count: 34

    Yeah that code didn’t do anything. I’m using the Kleo Child Theme if that makes any difference. When I place the shortcode [gd_place_listings] it doesn’t return anything… the text just appears on the website.

    #257292

    Kiran
    Moderator
    Post count: 7069

    Hi Clinton,

    You have added code in wrong file. The code should be added in theme “functions.php” not in “style.css”.

    BTW i have moved code into “functions.php” file now listings shortcodes working fine.

    Thanks

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