[Resolved] Removing "By" from author byline

Home Forums Support [Resolved] Removing "By" from author byline

Home Forums Support Removing "By" from author byline

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #543497
    Rolandas

    Hi

    How to remove “By” from author byline?
    Because it is an incorrect language design when the text is in Lithuanian.
    Incorrect: 2018-04-06 by Name Surname
    Correct: 2018-04-06 Name Surname

    GeneratePress 2.0.2
    GP Premium 1.6.2
    #543882
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Give this function a try:

    add_filter( 'generate_post_author_output', 'tu_remove_by_byline' );
    function tu_remove_by_byline() {
    	printf( ' <span class="byline">%1$s</span>', // WPCS: XSS ok, sanitization ok.
    		sprintf( '<span class="author vcard" itemtype="https://schema.org/Person" itemscope="itemscope" itemprop="author"><a class="url fn n" href="%1$s" title="%2$s" rel="author" itemprop="url"><span class="author-name" itemprop="name">%3$s</span></a></span>',
    			esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    			/* translators: 1: Author name */
    			esc_attr( sprintf( __( 'View all posts by %s', 'generatepress' ), get_the_author() ) ),
    			esc_html( get_the_author() )
    		)
    	);
    }
    #543953
    Rolandas

    Thanks
    Very good, that works ๐Ÿ™‚

    I still have one request:
    From site library I loaded FlixFrame “Blogg”.
    How to separate a date and author with a vertical bar.
    I would like to keep the style like in the example from FlixFrame “Blogg”
    Vertical bar example

    #544204
    Tom
    Lead Developer
    Lead Developer

    Try this CSS:

    .author:before {
        content: "| ";
    }
    #544221
    Rolandas

    Thanks a lot!

    #544535
    Tom
    Lead Developer
    Lead Developer
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.