ThemeShaper Forums » Thematic

[closed]

How to remove the author link in Wordpress/Thematic

(5 posts)
  • Started 2 years ago by sixfootjames
  • Latest reply from sixfootjames
  • This topic is resolved
  1. Hi,

    I'd like to remove the 'Author' link from single posts on pages like this:
    http://goo.gl/9I8WJ

    In Thematic/library/extensions/content-extensions.php on line 721 I found where this is concatenated but I don't want to have to mess with the core file.

    I created the same folder structure in my theme, copied over the content-extensions.php file and made my changes there but this did not work.

    Is there something I am missing here? Is this the right route to go?

    Many thanks

    Posted 2 years ago #
  2. sowingseeds
    Member

    If you place a childtheme_override in your functions file you can achieve this. So taking the code in content-extensions.php make the adjustments you wish.

    function childtheme_override_postmeta_authorlink() {
    
    	    global $authordata;
    if(is_single()){
    //removed all the code here for the authordata
    }
    else {
    
    	    $authorlink = '<span class="meta-prep meta-prep-author">' . __('By ', 'thematic') . '</span>';
    	    $authorlink .= '<span class="author vcard">'. '<a class="url fn n" href="';
    	    $authorlink .= get_author_posts_url($authordata->ID, $authordata->user_nicename);
    	    $authorlink .= '" title="' . __('View all posts by ', 'thematic') . get_the_author_meta( 'display_name' ) . '">';
    	    $authorlink .= get_the_author_meta( 'display_name' );
    	    $authorlink .= '</a></span>';
    }
    	    return apply_filters('thematic_post_meta_authorlink', $authorlink);
    
    }

    All that will remain is the separator bar before 'published'. Can remove this with css or make another childtheme override, this time: childtheme_override_postheader_postmeta

    Hope that solves it.

    Posted 2 years ago #
  3. Works a charm Sowingseeds, thanks so much!

    http://pastie.org/pastes/3347804/text

    Posted 2 years ago #
  4. function childtheme_override_postmeta_authorlink() {
    
    global $authordata;
    if(is_single()){
    $authorlink = '<span class="meta-prep meta-prep-author">' . __('By ', 'thematic') . '</span>';
    $authorlink .= '<span class="author vcard">'. get_the_author_meta( 'display_name' ) . '</span>';
    }
    else {
    
    $authorlink = '<span class="meta-prep meta-prep-author">' . __('By ', 'thematic') . '</span>';
    $authorlink .= '<span class="author vcard">'. '<a class="url fn n" href="';
    $authorlink .= get_author_posts_url($authordata->ID, $authordata->user_nicename);
    $authorlink .= '" title="' . __('View all posts by ', 'thematic') . get_the_author_meta( 'display_name' ) . '">';
    $authorlink .= get_the_author_meta( 'display_name' );
    $authorlink .= '</a></span>';
    }
    return apply_filters('thematic_post_meta_authorlink', $authorlink);
    
    }
    Posted 2 years ago #
  5. you can also filter in this instance too (for reference) :

    function kia_change_authorlink($authorlink){
     global $authordata;
     if(is_single()){
       $authorlink = '<span class="meta-prep meta-prep-author">' . __('By ', 'thematic') . '</span>';
       $authorlink .= '<span class="author vcard">'. get_the_author_meta( 'display_name' ) . '</span>';
     }
     return $authorlink;
    }
    add_filter('thematic_post_meta_authorlink','kia_change_authorlink');

    btw- please wrap code in backtick marks

    Posted 2 years ago #
  6. Thanks Helga! :)

    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.