User Dashboard: Default Post Type

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

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

Open Support Ticket
  • Author
    Posts
  • #405630

    dmitriy
    Expired Member
    Post count: 9

    Hi team, I searched, but could not find the answer. I suspect this is a common enough question. I only have one post type under GD — “schools”. Is it possible to default the links in the User Dashboard Widget to that post type? I am referring to the Dashboard that shows up on the sidebar of individual listings. Maybe there’s a way to show regular links rather than the “Chosen” multi-select dropdown box? Thanks in advance!

    #405689

    Guust
    Moderator
    Post count: 29970

    If you only have one CPT, then there should be no other links showing, but only your default CPT?
    The links in the dashboard widget are controlled at GD > Design > Navigation: https://wpgeodirectory.com/docs/core-design/#userlinks

    Thanks

    #405692

    Alex Rollin
    Moderator
    Post count: 27815

    Hello!

    There isn’t a setting for that, so it isn’t possible without a customization. You can give it a try yourself or hire a dev, and if you run into trouble post your code back here for review.

    Are you using UsersWP?

    If you are, that link will be static and point to the author page like:

    https://mysite.com/profile/myaccountnickname/

    You might want to just make a ‘logged in users’ text widget with some pretty links like that.

    Let us know

    #405776

    dmitriy
    Expired Member
    Post count: 9

    Yep, I ended up coding a shortcode that echoes out the links when a user is logged on. It would be a welcome feature it did it by default if there’s only one CPT. Thanks!

    #405801

    Alex Rollin
    Moderator
    Post count: 27815

    Nicely done!

    Feel free to share!

    #405806

    dmitriy
    Expired Member
    Post count: 9

    Sure, here’s what I did:

    
    
    add_shortcode('geo-action-links', 'geo_action_links');
    
    function geo_action_links() {
    	if (is_user_logged_in()) {
    		global $current_user;
    		get_currentuserinfo();
    		ob_start(); ?> 
    		<div class="lwh-action-links">
    			<a class="lwh-action-link" href="<?php echo get_author_posts_url($current_user->ID); ?>?geodir_dashbord=true&stype=gd_place">Manage My School(s)</a>
    			<a class="lwh-action-link" href="<?php bloginfo('url'); ?>/add-listing/?listing_type=gd_place">Add New School</a>
    			<a class="lwh-action-link" href="<?php echo get_author_posts_url($current_user->ID); ?>?geodir_dashbord=true&stype=gd_place&list=favourite">My Saved Schools</a>
    		</div>
    	<?php
    		return ob_get_clean();
    	}
    }
    #405844

    Alex Rollin
    Moderator
    Post count: 27815

    Hey hey! That’s great, thanks for sharing!

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

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

Open Support Ticket