• Resolved onethinginteresting

    (@onethinginteresting)


    I do no want the below chuck of code to be run on my website, which is located in the single.php file in the Fashionista theme. I’d like to code the removal of this in my child theme as opposed to removing it from the parent theme. How do I do this?

    https://onethinginteresting.com/2013/12/floral-and-plaid-scarf/. I don’t want the author section to show.

    Thank you!

    <div class="clearfix author-info">
    				<div class="author-photo"><?php echo get_avatar( get_the_author_meta( 'ID' ) , 75 ); ?></div>
    				<div class="author-content">
    					<h3><?php the_author(); ?></h3>
    					<p><?php the_author_meta( 'description' ); ?></p>
    					<div class="author-links">
    						<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" rel="me">More Posts</a>
    
    						<?php if ( get_the_author_meta( 'twitter' ) ) : ?>
    						<a href="https://twitter.com/<?php echo get_the_author_meta( 'twitter' ); ?>">Twitter</a>
    						<?php endif; ?>
    
    						<?php if ( get_the_author_meta( 'facebook' ) ) : ?>
    						<a href="https://facebook.com/<?php echo get_the_author_meta( 'facebook' ); ?>">Facebook</a>
    						<?php endif; ?>
    
    						<?php if ( get_the_author_meta( 'linkedin' ) ) : ?>
    						<a href="https://linkedin.com/in/<?php echo get_the_author_meta( 'linkedin' ); ?>">LinkedIn</a>
    						<?php endif; ?>
    					</div>
    				</div>
    			<!-- .author-info --></div>
Viewing 4 replies - 1 through 4 (of 4 total)
  • You can hide that information by adding this to your child CSS. It will still “run” it just wont display on the pages.

    author-info {
        display: none;
    }

    You should not however edit style.css directly. There are plugins out there that let you introduce this kind of small CSS chnages without the need for child theme – for example My Custom CSS. Jetpack also has ‘Edit CSS’ feature.
    Good luck!

    Thread Starter onethinginteresting

    (@onethinginteresting)

    Thank you both!

    When I entered the above code (.author-info), the information was removed but now the letter “c” seems to be randomly showing up in that space. Any ideas why this happened?

    https://onethinginteresting.com/2013/12/floral-and-plaid-scarf/

    Thread Starter onethinginteresting

    (@onethinginteresting)

    Nevermind, I must have accidentally added a “c” to the single.php parent file when I was looking at it.

    Your fix works. Thanks again!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to remove code from parent theme in child theme’ is closed to new replies.