• Resolved anjb

    (@anjb)


    I have followed previous instructions and removed

    printf( __( ‘Posted by %1$s on %2$s’, ‘parament’ ),
    sprintf( ‘%3$s‘,
    esc_url( get_author_posts_url( get_the_author_meta( ‘ID’ ) ) ),
    esc_attr( sprintf( __( ‘View all posts by %1$s’, ‘parament’ ), get_the_author() ) ),
    esc_html( get_the_author() )
    ),
    ‘ . esc_html( get_the_date() ) . ‘
    );

    from the contents.php file in the parent theme, but the information is still there.

    https://www.paint-tech.co.uk

    Any guidance would be much appreciated. Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • a:
    don’t edit anything in the parent theme; make a copy of the template into the child theme and edit it there.

    b:
    did you also check the other content-{…}.php files?

    can you post a direct link to a post/page with the ‘posted by’ still showing?

    Thread Starter anjb

    (@anjb)

    I have created a child theme, and I know it’s not best practice to mess with parent theme files but I was confused as to whether a duplicate contents.php file would overrule the file in the parent theme? I know it doesn’t work quite the same way as .css files.

    Here’s the link:

    https://paint-tech.co.uk/what-we-do/alloy-wheel-before/

    Thread Starter anjb

    (@anjb)

    Apologies. I was getting confused with the functions.php file. I’ve now created copies of Template files in child theme.

    the link is to a static page which should, according to the code in content-page.php, not show any ‘posted by’ info;

    have you edited/removed content-page.php from the parent theme?

    Thread Starter anjb

    (@anjb)

    The ‘Posted by’ info appears whenever you click on one of the Gallery images. I haven’t made any changes to content-page.php. Could it be because I created the Gallery before removing the code from contents.php? Thanks again for looking at this for me.

    make a copy of image.php into the child theme, and edit it;

    remove:

    <span><?php
    				printf( __( 'Posted by %1$s on %2$s', 'parament' ),
    					sprintf( '<a href="%1$s" title="%2$s">%3$s</a>',
    						esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    						esc_attr( sprintf( __( 'View all posts by %1$s', 'parament' ), get_the_author() ) ),
    						esc_html( get_the_author() )
    					),
    					'<a href="' . esc_url( get_permalink() ) . '">' . esc_html( get_the_date() ) . '</a>'
    				);
    				?></span>
    Thread Starter anjb

    (@anjb)

    Thank you so much. That works perfectly.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Remove 'Posted by' info in Parament theme’ is closed to new replies.