Wordpress Plugins•Member List display and link
-
Hi! I've managed to cobble together a bit of what I want, but I think I've reached a wall.
I found that the author links generated by the plug-in weren't working - instead of the ?author=3 type link, my author template only kicked in with a link to /index.php/author/authorname/
Well - it took some doing (I'm certainly no php programmer) but I managed to adjust the plug-in code to provide that link, and apply it to the gravitar/photo in the directory listing - step one, accomplished!
Next, I used the admin area to configure the mark-up and get the first_name and last_name to display on the same line, instead of one under the other - step two accomplished!
THEN - I wanted to apply the adjusted link to the author's name... BUT, since the author's name is really made up of two distinct %value% entries just placed next to each other, rather than a single unit, I can't get the a href to work - something like:
a href="../index.php/author/%value%
that's opened on the first_name only includes the value for first_name in the link, even if I don't close the in the next, last_name, item.
What I've tentatively done is add the nice_name variable and applied the link to that, but now, of course, I have the user's login name displayed over their "user friendly" first/last name.
Example here: http://clinical-mindfulness.org/member-directory/
So, ideally... I'd like the author link on the author's name... possible?
-
Can you send me a screenshot of your mark-up editing page with everything the way you wan it?
matthew@ternstyle.us
-
Well, I think that's the problem, isn't it? If I could get the editing page the way I wanted it, I wouldn't have any problems, right?
I can tell you how I'd *like* the code t be laid out, if that helps.
-
post contained mark-up that got stripped out...
-
crud - it strips out mark-up...
-
James, Put this before the %value% in the first name field: <a href="%author_url%">
And before the </div> in the last name field put this: </a>
-
That doesn't work - it gives me a link like: /author/1 - remember, I mentioned in the first post that the author links generated by the plugin don't work. Even though I have an author.php template set up, only links in the format /author/name actually work.
-
If you head over to the page: http://clinical-mindfulness.org/member-directory/
And hover over the thumbnail, you get this link: http://clinical-mindfulness.org/index.php/index.php/author/Richard%20Sears
That link works.
If you click on the username, in the first instance, richard-sears, you get this link: http://clinical-mindfulness.org/index.php/author/richard-sears
That link works.
If you click on the properly formatted name, Richard Sears, using the code you suggested, you get this link:
http://clinical-mindfulness.org/index.php/index.php/author/3
That link does NOT work.
So what I'm trying to figure out is how to get one of the working links around the properly formatted name.
-
I'm sorry James. I was having trouble understanding you. I get the author url issue now. Currently there is no good solution without editing the plugin itself.
change line 877 of tern_wp_members.php from this: $s .= "\n ".str_replace('%author_url%',get_bloginfo('url').'/?author='.$u->ID,str_replace('%value%',$u->$v['name'],$v['markup']));
to this: $s .= "\n ".str_replace('%author_url%',get_bloginfo('wpurl').'/?author='.$u->user_nicename,str_replace('%value%',$u->$v['name'],$v['markup']));
Let me know if that works.
-
It didn't work at first, but I changed the '/?author=' to 'index.php/author/' instead, and it works perfectly now - thanks!
-
You're welcome. That's great!
