Tagged: author, Buddypress, link
-
AuthorPosts
-
December 29, 2014 at 7:47 pm #372769
Hi there,
Currently, when browsers click on the avatar profile picture of the author of the blog, it brings them to the buddypress page with the profile of the author, is there a way to simply change that link to another page on the website? I’d like it to redirect to the trainer profile section.
Here is an example:
http://energyzone.ca/the-gobi-runner-most-inspirational-story-since-prefontaine/
Thanks!
Ben
December 29, 2014 at 8:38 pm #372794Hi a00109943!
You can change that on line 114 in /enfold/includes/loop-index.php.
$link = get_author_posts_url($post->post_author);
Best regards,
ElliottDecember 30, 2014 at 6:36 pm #373234Hi Elliott,
Thanks alot for your help! I found the line in the php file, but I am not familiar with how to include the url there? What should I be replacing in this line? I would like the author icons to redirect to:
http://energyzone.ca/benjamin/
Thanks again!
Ben
December 30, 2014 at 7:16 pm #373256Hey!
Try this.
$link = "http://energyzone.ca/benjamin/";
Cheers!
ElliottDecember 30, 2014 at 11:18 pm #373348That worked beautifully! I guess the limitation is that we can only have them redirect to one page all the time, if they click on a different author it will still link to that page as well?
Either way, thank you so much!
ben
December 31, 2014 at 12:10 am #373364Hi!
You can use this function to check for certain authors, http://codex.wordpress.org/Function_Reference/is_author.
Regards,
ElliottJanuary 12, 2015 at 9:27 am #378188Hello Elliott,
I also want to redirect the author page to a different links, but how can I do that if I have multiple authors? I don’t know how exactly to implement the is_author code for more authors. Can you give an example for two authors? Thanks in advance!
Best regards,
Conny Loonstra
January 12, 2015 at 10:01 pm #378548Hey!
Probably something like this.
if ( is_author('Benjamin') ) { $link = "http://energyzone.ca/benjamin/"; } if ( is_author("David") ) { $link = "http://energyzone.ca/david/"; }
Regards,
ElliottJanuary 13, 2015 at 12:12 pm #378722Thanks Elliott, however I might have done something wrong, because it keeps redirecting to the wrong page. I tried the following for ‘gastblogger’:
$gravatar = get_avatar($author_email, ’81’, “blank”, $gravatar_alt);
if ( is_author(‘275’) ) { $link = “http://paardenlifestyle.com/tv/conny/”; }
}I tried with the name first and after that with id, but both didn’t work. You can check it with this blog:
http://paardenlifestyle.com/jenny-veenstra-presteren-met-een-minder-ideaal-paard-het-is-mogelijk/
Can you tell what I’m doing wrong?
January 13, 2015 at 10:12 pm #379139Hey!
That’s the single post view. You can find that one in the same file on line 177.
the_author_posts_link();
Cheers!
ElliottJanuary 13, 2015 at 10:24 pm #379145Hey Elliott,
thank you for your reply! So I have to change that line; could you give me an example? I just did it wrong and crashed the page. Whoops
Thanks in advance!
January 14, 2015 at 7:00 pm #379661Hey!
Try replacing it with this.
if ( is_author('Daniel') ) { echo "<a href = 'http://www.yoursite.com'>Author name</a>"; }
Cheers!
Elliott- This reply was modified 9 years, 11 months ago by Elliott.
February 1, 2015 at 8:57 pm #389066Hey Elliott,
thank you for your reply. Sorry for my late response, but I was on holiday for two weeks and I didn’t have access to my FTP on holiday, so I didn’t want to risk crashing my website ;)
Anyway, I’ve changed line 177 instead of 114, at least, that’s what I think you meant. However, now the link disappears. I have the following code on line 177:
if ( is_author('gastblogger') ) { echo "<a href='http://paardenlifestyle.com/tv/conny/'>Gastblogger</a>"; }
You can see an example here: http://paardenlifestyle.com/jenny-veenstra-presteren-met-een-minder-ideaal-paard-het-is-mogelijk/
This post is written by gastblogger or ID 275.
I have no clue what I might be doing wrong. I hope you have an idea! Thanks in advance for your reply.
Best regards,
Conny
- This reply was modified 9 years, 10 months ago by Elliott.
February 2, 2015 at 10:06 pm #389679Hi!
Send us a WordPress login and we’ll take a look.
Cheers!
ElliottFebruary 2, 2015 at 10:18 pm #389690This reply has been marked as private.February 3, 2015 at 8:45 pm #390353Hi!
I’m sorry but you have too many customizations going on here.
1. I tried finding your loop-index.php file in the dashboard editor but it looks like you have two created? I looked through those and I saw the customization your doing but it’s not displaying on the front end for some reason. What is displaying is the text “door” which I have no idea where that is coming from.
2. You have 113 users and I could not find the gastblogger you were referring to.
3. It looks like you did a customization to enable the avia layout editor on posts which is going to make it so the meta does not display anyway.
I’m sorry but I think it would be best to hire a freelancer to help you out here because there is just too much customization for me to know what’s going on.
Cheers!
Elliott- This reply was modified 9 years, 10 months ago by Elliott.
February 3, 2015 at 9:09 pm #390371This reply has been marked as private.February 4, 2015 at 9:39 pm #390937Hey!
The loop-index.php file is still not displaying any changes I make to it. I tried editing your child theme and also in the parent theme. Perhaps it’s some kind of caching issue with your plugins.
Regards,
ElliottFebruary 10, 2015 at 12:01 am #393412This reply has been marked as private.February 10, 2015 at 9:02 pm #393970Hey!
It’s working fine on my XAMPP setup but I do not know why it’s not working on yours. Perhaps it’s due to a customization you have already done or one of the many plugins your using. It would be best to hire a freelancer to help you out with this customization.
Regards,
ElliottFebruary 11, 2015 at 10:50 am #394190Okay, I will do that. Thank you SO much for your time and effort! Really appreciate it!
Best regards,
Conny
February 11, 2015 at 1:27 pm #394299 -
AuthorPosts
- The topic ‘Redirect Author Picture link to another page’ is closed to new replies.