Creating link to author page

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

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

Open Support Ticket
  • Author
    Posts
  • #371615

    Richard Aronson
    Free User
    Post count: 50

    I am working on this site, seniorian.com, and I would like to place a link directly to the listing author’s page in several places. For example, when I am logged into the site, the link to my dashboard is https://seniorian.com/author/richardaronson/?geodir_dashbord=true&stype=gd_place. How do I format the link to go to the same place but for each user?

    #371656

    Kor
    Moderator
    Post count: 16516

    Hi Richard,

    Sorry, I’m not really sure if I’m getting this. Could you perhaps elaborate a little bit more or probably provide us some screenshots of what you’re trying to achieve there?

    Thanks!

    #371657

    Giri
    Expired Member
    Post count: 3155

    Hi Richard, most likely you would require a custom function for this.

    
    
    function display_author_link_by_id($user_id, $ptype) {
       $author_link = get_author_posts_url( $user_id );
       $listing_link = geodir_getlink( $author_link, array( 'stype' => $ptype ), false );
       echo $listing_link;
    }

    You need to use code like this wherever you need that link.

    <?php display_author_link_by_id(1, 'gd_place'); ?>
    #371862

    Richard Aronson
    Free User
    Post count: 50

    Hello Giri – I would like to put the author link inside the “My Dashboard” box. I want to have some text that reads, “Edit or upgrade your listing” and then have the link to their author page. How would I do that with the code above?

    #373234

    Richard Aronson
    Free User
    Post count: 50

    Right now, I am able to get a link in My Dashboard using the following code:

    
    
    add_filter('geodir_dashboard_links','_my_dashboard_links',10);
    function _my_dashboard_links($dash_links){
    	$dash_links .= "<li><a href='https://seniorian.com/author/user_id/?geodir_dashbord=true&stype=gd_place'>Edit or Upgrade Your Listing</a></li>";
    	return $dash_links;
    }

    I am not sure how to get the author link code above to show up in My Dashboard. Any help would be greatly appreciated. I am attaching a screenshot of My Dashboard to show what I am trying to achieve. In the screenshot you will see that it says ‘Edit or upgrade your listing.’ That is where I want the author link to go so that someone who has listed on the site can go directly to their listings.

    #375576

    Richard Aronson
    Free User
    Post count: 50

    Can anyone please help me with this? I am trying to add a link to go directly to the listing author’s page to make it easy for lister’s to edit and add listings. At this point, I am willing to add a custom link in the menu that will take someone to their listing author page. How do I do this?

    #375948

    Giri
    Expired Member
    Post count: 3155

    Hi Richard,

    I think you can use my previous code with your code.

    
    
    add_filter('geodir_dashboard_links','_my_dashboard_links',10);
    function _my_dashboard_links($dash_links){
            $author_link = get_author_posts_url( $user_id );
            $listing_link = geodir_getlink( $author_link, array( 'stype' => $ptype ), false );
    	$dash_links .= "<li><a href='".listing_link."'>Edit or Upgrade Your Listing</a></li>";
    	return $dash_links;
    }

    Let me know how that goes.

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
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount