Community Forums › Forums › Archived Forums › Design Tips and Tricks › Customize author link in post info
Tagged: .post-info, author archives
- This topic has 9 replies, 2 voices, and was last updated 12 years, 8 months ago by
Aditya Pandey.
-
AuthorPosts
-
May 15, 2013 at 3:19 am #40962
stefaanoyen
MemberHi there,
I have this code in my functions.php:
/** Customize the post info function */
add_filter( 'genesis_post_info', 'post_info_filter' );
function post_info_filter($post_info) {
if (!is_page()) {
$post_info = '
<div class=\'date-info\'>' .
__('Gepost op', 'executive' ) .
' [post_date format="d-m-Y" before="<span class=\'date\'>" after="</span>"] ' .
__('by', 'executive' ) . ' [post_author_posts_link] [post_edit]
</div>
<div class="comments">
[post_comments zero="Reageer" one="1 Reactie" more="% Reacties"]
</div>';
return $post_info;
}
}It now shows the post author name which links to my post author archives, but I want the post author name to link to a custom URL, let's say 'http://www.mydomain.com/aboutme'. How do I do this?
Thank you!
Stefaan
May 15, 2013 at 8:43 am #40999Aditya Pandey
MemberHere's your customized function:
`/** Customize the post info function */
add_filter( ‘genesis_post_info’, ‘post_info_filter’ );
function post_info_filter($post_info) {
if (!is_page()) {
$post_info = ‘
<div class=\’date-info\’>’ .
__(‘Gepost op’, ‘executive’ ) .
‘ [post_date format="d-m-Y" before="<span class=\'date\'>" after="</span>"] ‘ .
__(‘by’, ‘executive’ ) . ‘ [post_author before="<a href="http://www.mydomain.com/aboutme" rel="nofollow">" after="</a>"] [post_edit]
</div>
<div class=”comments”>
[post_comments zero="Reageer" one="1 Reactie" more="% Reacties"]
</div>’;
return $post_info;
}
}`Happy? 🙂
Hire me >> http://adityaworks.com/contact.php
May 15, 2013 at 8:59 am #41007stefaanoyen
MemberNot yet 🙂
It just shows the name of the author, no link...
Any idea what went wrong?
Thanks for your reply!
Stefaan
May 15, 2013 at 9:02 am #41009Aditya Pandey
MemberYes, this fuc*ing WYSIWYG stripped my code.
Try this: http://pastebin.com/PbX5cCL0
Edit: Wait, doing something...
Edit 2: This will work:
http://pastebin.com/7pghjNmb
Hire me >> http://adityaworks.com/contact.php
May 15, 2013 at 9:12 am #41015Aditya Pandey
MemberAlso, you should remove rel="nofollow" in my function.
Hire me >> http://adityaworks.com/contact.php
May 15, 2013 at 9:18 am #41018stefaanoyen
MemberDamn, syntax error : (
Sorry I can't help, PHP is not my cup of tea 🙂
May 15, 2013 at 9:18 am #41020Aditya Pandey
MemberCan you give me link to your site?
Edit: Also paste your function (un-modified) on pastebin and give me link, please.
Hire me >> http://adityaworks.com/contact.php
May 15, 2013 at 9:30 am #41023stefaanoyen
MemberThis reply has been marked as private.May 16, 2013 at 4:58 am #41165stefaanoyen
MemberDid you get the link to my site and the paste? I sent it in a private message.
May 16, 2013 at 7:47 am #41180Aditya Pandey
MemberNo. I think only mods and admin can see that.
Edit: Mail me your private info here (along title and with link of this thread): http://iamaditya.org/contact-me/
Hire me >> http://adityaworks.com/contact.php
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.