Show the author, but hide its link!

  • maria cap

    #1607

    Dear Syahir,

    first of all thanks a lot for your wonderful job. i’m gonna support you (at least) purchasing the mobile plugin as soon as my site will be finished.

    You can check it out at http://www.marcolongoni.com

    Right now, the author link in posts is hidden. I’d like to show it, but hide the link to the author’s profile, for two reasons:

    -First of all it’s gonna be a single author blog

    -Hiding the admin’s username in the frontend is a good starting point at securing your wordpress, but when the author link it’s enabled, it links to site.com/username, not at site.com/ScreenName – and that breaks this type of hardening.

    I would like to support you even by providing better/most complete it_IT files, just please tell me how.

    Admin

    Syahir Hakim

    #16478

    Add this to your child theme’s functions.php file:

    <?php
    function graphene_author_nolink(){
    return get_the_author();
    }
    add_filter( 'the_author_posts_link', 'graphene_author_nolink' );
    ?>

    Btw, love the colours on your site!

    marcolongoni

    #16479

    Unfortunately i’ve never created a child theme, as i’ve been playing with wordpress and your theme for many days before getting on this forum and reading about child theme.

    I don’t want to go offtopic, but i’m wondering if i may make some type of diff and output redirection in bash to get my modifications out of the code… i did modifications to php even, not just the css!

    about the colors, i’ll tell my friend and art director Filippo about your appreciation!

    Admin

    Syahir Hakim

    #16480

    Okay, then you can directly edit the theme’s loop.php file. Just replace the following code:

    the_author_posts_link();

    with this one:

    echo get_the_author();

    marcolongoni

    #16481

    The blog page now dies after the title of the first post, with this: Fatal error: call to undefined function get_post_author() in /full/path/to/loop.php on line 117

    Admin

    Syahir Hakim

    #16482

    Oops…sorry, it should be get_the_author() instead of get_post_author(). I’ve also edited the posts above.

    marcolongoni

    #16483

    Your solution now works like a charm (loop.php mod): http://www.marcolongoni.com/blog/

    Anyway, i don’t give up on building my own child theme, as i don’t want to miss any updates!

    Thank you so much!

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.