[Resolved] Post – Author – 301

Home Forums Support [Resolved] Post – Author – 301

Home Forums Support Post – Author – 301

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1158144
    Pascal

    Hi,

    need your help please, tell me how on a post what is the step by step to remove the author link and section category.

    It is causing 301 rotation problems on the site, because we prefered to do not publish these page.

    top post

    View post on imgur.com

    end of post

    View post on imgur.com

    Thank You.

    #1158437
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You can remove the author link like this: https://docs.generatepress.com/article/generate_post_author_output/#remove-link

    To remove the category link, try this:

    add_filter( 'generate_category_list_output', function() {
        $categories = apply_filters( 'generate_show_categories', true );
    
        $term_separator = apply_filters( 'generate_term_separator', _x( ', ', 'Used between list items, there is a space after the comma.', 'generatepress' ), 'categories' );
        $categories_list = get_the_category_list( $term_separator );
    
        return sprintf( '<span class="cat-links">%3$s<span class="screen-reader-text">%1$s </span>%2$s</span> ', // WPCS: XSS ok, sanitization ok.
            esc_html_x( 'Categories', 'Used before category names.', 'generatepress' ),
            strip_tags( $categories_list ),
            apply_filters( 'generate_inside_post_meta_item_output', '', 'categories' )
        );
    } );

    Let me know ๐Ÿ™‚

    #1158970
    Pascal

    Thank you this code need to be added in the CSS file ?

    #1159005
    Leo
    Staff
    Customer Support
    #1159064
    Pascal

    Thank you it works and it fixes now.

    #1159295
    Tom
    Lead Developer
    Lead Developer

    Glad I could help ๐Ÿ™‚

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