Viewing 22 posts - 1 through 22 (of 22 total)
  • Author
    Posts
  • #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

    #372794

    Hi a00109943!

    You can change that on line 114 in /enfold/includes/loop-index.php.

    $link = get_author_posts_url($post->post_author);
    

    Best regards,
    Elliott

    #373234

    Hi 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

    #373256

    Hey!

    Try this.

    $link = "http://energyzone.ca/benjamin/";
    

    Cheers!
    Elliott

    #373348

    That 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

    #373364

    Hi!

    You can use this function to check for certain authors, http://codex.wordpress.org/Function_Reference/is_author.

    Regards,
    Elliott

    #378188

    Hello 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

    #378548

    Hey!

    Probably something like this.

    if ( is_author('Benjamin') ) { $link = "http://energyzone.ca/benjamin/"; }
    if ( is_author("David") ) { $link = "http://energyzone.ca/david/"; }

    Regards,
    Elliott

    #378722

    Thanks 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?

    #379139

    Hey!

    That’s the single post view. You can find that one in the same file on line 177.

    the_author_posts_link();
    

    Cheers!
    Elliott

    #379145

    Hey 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!

    #379661

    Hey!

    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.
    #389066

    Hey 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.
    #389679

    Hi!

    Send us a WordPress login and we’ll take a look.

    Cheers!
    Elliott

    #389690
    This reply has been marked as private.
    #390353

    Hi!

    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.
    #390371
    This reply has been marked as private.
    #390937

    Hey!

    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,
    Elliott

    #393412
    This reply has been marked as private.
    #393970

    Hey!

    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,
    Elliott

    #394190

    Okay, I will do that. Thank you SO much for your time and effort! Really appreciate it!

    Best regards,

    Conny

    #394299

    Hi!

    Glad we could help you. Enjoy the theme.
    Feel free to come back with further questions.

    Best regards,
    Günter

Viewing 22 posts - 1 through 22 (of 22 total)
  • The topic ‘Redirect Author Picture link to another page’ is closed to new replies.