• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Customize author link in post info

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Customize author link in post info

This topic is: not resolved

Tagged: .post-info, author archives

  • This topic has 9 replies, 2 voices, and was last updated 10 years, 4 months ago by Aditya Pandey.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • May 15, 2013 at 3:19 am #40962
    stefaanoyen
    Member

    Hi 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 #40999
    Aditya Pandey
    Member

    Here'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? 🙂


    Aditya Works.

    Hire me >> http://adityaworks.com/contact.php

    May 15, 2013 at 8:59 am #41007
    stefaanoyen
    Member

    Not 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 #41009
    Aditya Pandey
    Member

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


    Aditya Works.

    Hire me >> http://adityaworks.com/contact.php

    May 15, 2013 at 9:12 am #41015
    Aditya Pandey
    Member

    Also, you should remove  rel="nofollow" in my function.


    Aditya Works.

    Hire me >> http://adityaworks.com/contact.php

    May 15, 2013 at 9:18 am #41018
    stefaanoyen
    Member

    Damn, syntax error : (

    Sorry I can't help, PHP is not my cup of tea 🙂

    May 15, 2013 at 9:18 am #41020
    Aditya Pandey
    Member

    Can you give me link to your site?

    Edit: Also paste your function (un-modified) on pastebin and give me link, please.


    Aditya Works.

    Hire me >> http://adityaworks.com/contact.php

    May 15, 2013 at 9:30 am #41023
    stefaanoyen
    Member
    This reply has been marked as private.
    May 16, 2013 at 4:58 am #41165
    stefaanoyen
    Member

    Did you get the link to my site and the paste? I sent it in a private message.

    May 16, 2013 at 7:47 am #41180
    Aditya Pandey
    Member

    No. 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/


    Aditya Works.

    Hire me >> http://adityaworks.com/contact.php

  • Author
    Posts
Viewing 10 posts - 1 through 10 (of 10 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble