• I can’t seem to figure out how to remove the “Written by AUTHOR” text via a hook in the functions.php file. Can anyone lend a hand with this (NOT with CSS, but with hooks only please.)?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Serene Themes

    (@rlafranchi)

    You can use a childtheme override function, for the author meta, the following function will work:

    function childtheme_override_postmeta_authorlink() {
      //custom code
    }
    Theme Author Serene Themes

    (@rlafranchi)

    Here’s the original code for reference:

    function cleanyetibasic_postmeta_authorlink() {
    		global $authordata;
    
    	    $author_prep = '<span class="meta-prep meta-prep-author">' . __('By', 'cleanyetibasic') . ' </span>';
    
    	    if ( cleanyetibasic_is_custom_post_type() && !current_theme_supports( 'cleanyetibasic_support_post_type_author_link' ) ) {
    	    	$author_info  = '<span class="vcard"><span class="fn nickname">';
    	    	$author_info .= get_the_author_meta( 'display_name' ) ;
    	    	$author_info .= '</span></span>';
    	    } else {
    	    	$author_info  = '<span class="author vcard">';
    	    	$author_info .= sprintf('<a class="url fn n" href="%s" title="%s">%s</a>',
    	    							get_author_posts_url( $authordata->ID, $authordata->user_nicename ),
    									/* translators: author name */
    	    							sprintf( esc_attr__( 'View all posts by %s', 'cleanyetibasic' ), get_the_author_meta( 'display_name' ) ),
    	    							get_the_author_meta( 'display_name' ));
    	    	$author_info .= '</span>';
    	    }
    
    	    $author_credit = $author_prep . $author_info ;
    
    	    return apply_filters('cleanyetibasic_postmeta_authorlink', $author_credit);
    
    	}
    Thread Starter Brandon Moner

    (@ctvonline)

    Thanks for that

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Using Hook to Remove Author Meta’ is closed to new replies.