WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Remove Author | Remove Comments

[Resolved] Remove Author | Remove Comments

  • Samara

    @blouishhotmailcom

    Hi guys I’m working on this site; http://mrsdalrymple.com/ it’s WordPress 3.2.1 using the Brunelleschi theme.

    I want to remove “by LONDONBOUND ” author text from each post. I’ve looked through the trees for code etc. But I’m not understanding A) where to find the index.php and also whenever I find an index.php it doesn’t have much if any code in it.

    I want to remove the ability to comment on the actual pages. Again I don’t know where to find the page within the ftp and what code to add or remove.

    Thanks for any help.

Viewing 15 replies - 1 through 15 (of 22 total)
  • You would have to navigate to the /wp-content/themes/”your theme name”/ and while each theme differs, it should be somewhere in there, not necessarily in index.php. You may need to edit loop.php, or single.php depending.

    Other than that, you could hide this by editing your style.css file.

    Below Line 963, add display: none to the .entry-meta block of CSS.

    .entry-meta {
    color: #899A21;
    font-size: 12px;
    display: none;
    }

    NOTE: This will hide anything across the website that is displayed in the entry-meta div.

    Samara

    @blouishhotmailcom

    Ahh I did the CSS line but it hides the date of the posting. The site author wants to be able to see the date but not the author.

    Then you’ll have to track down the php file in the theme containing the format for outputting the author, and remove that line. Take a backup in case you break it.

    Samara

    @blouishhotmailcom

    Unfortunately I do not know what piece of code to look for within the files. I’ve searched for “author” but I am not finding anything.

    Also still need to remove comments on the pages.

    You should be looking for one of the following tags within the theme files, either in the loop.php or single.php files.

    http://codex.wordpress.org/Template_Tags#Author_tags

    Also, you should be finding this:

    <?php comments_template(); ?>

    To this:

    <?php //comments_template(); ?>

    Samara

    @blouishhotmailcom

    I found this in loop-attachment.php

    <header>
    						<h2 class="entry-title"><?php the_title(); ?></h2>
    
    						<div class="entry-meta">
    							<?php
    								printf( __( '<span class="%1$s">By</span> %2$s', 'brunelleschi' ),
    									'meta-prep meta-prep-author',
    									sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
    										get_author_posts_url( get_the_author_meta( 'ID' ) ),
    										sprintf( esc_attr__( 'View all posts by %s', 'brunelleschi' ), get_the_author() ),
    										get_the_author()
    									)
    								);
    							?>
    							<span class="meta-sep">|</span>
    							<?php
    								printf( __( '<span class="%1$s">Published</span> %2$s', 'brunelleschi' ),
    									'meta-prep meta-prep-entry-date',
    									sprintf( '<span class="entry-date"><abbr class="published" title="%1$s">%2$s</abbr></span>',
    										esc_attr( get_the_time() ),
    										get_the_date()
    									)
    								);
    								if ( wp_attachment_is_image() ) {
    									echo ' <span class="meta-sep">|</span> ';
    									$metadata = wp_get_attachment_metadata();
    									printf( __( 'Full size is %s pixels', 'brunelleschi' ),
    										sprintf( '<a href="%1$s" title="%2$s">%3$s &times; %4$s</a>',
    											wp_get_attachment_url(),
    											esc_attr( __( 'Link to full-size image', 'brunelleschi' ) ),
    											$metadata['width'],
    											$metadata['height']
    										)
    									);
    								}
    							?>
    							<?php edit_post_link( __( 'Edit', 'brunelleschi' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
    						</div><!-- .entry-meta -->
    					</header>

    And in the loop-single.php file I found this;

    <?php if ( get_the_author_meta( 'description' ) ) :  ?>
    					<div id="entry-author-info">
    						<div id="author-avatar">
    							<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'brunelleschi_author_bio_avatar_size', 60 ) ); ?>
    						</div><!-- #author-avatar -->
    						<div id="author-description">
    							<h2><?php printf( esc_attr__( 'About %s', 'brunelleschi' ), get_the_author() ); ?></h2>
    							<?php the_author_meta( 'description' ); ?>
    							<div id="author-link">
    								<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
    									<?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'brunelleschi' ), get_the_author() ); ?>
    								</a>
    							</div><!-- #author-link	-->
    						</div><!-- #author-description -->
    					</div><!-- #entry-author-info -->

    Should I be simply deleting that entire code?

    loop-attachment.php refers to posts you’ve marked as attachment. DO NOT DELETE THIS.

    loop-single.php this block of code you’ve posted is NOT generating the code you wish to remove.

    Samara

    @blouishhotmailcom

    Hmm. I’m at a loss then. Here are the entire pages of both the loop.php and single.php

    Single.php

    [code removed – for future posting of code, please use the http://pastebin.com/ ]

    Right,

    You’re supposed to use pastebin for your code.

    So on actually looking at the code, as you’re using a custom theme, it looks like this is where the author and date are being generated.

    <?php brunelleschi_posted_on(); ?>

    In the first block of code you should comment out the following:

    <?php comments_template( '', true ); ?>

    And:

    <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'brunelleschi' ), __( '1 Comment', 'brunelleschi' ), __( '% Comments', 'brunelleschi' ) ); ?></span>

    AS ALWAYS, take a BACKUP in case anything should go awry.

    Samara

    @blouishhotmailcom

    By removing the <?php brunelleschi_posted_on(); ?> it also removed the date the entry was posted which I would still need to keep in there.

    The second two codes are to remove the comments I assume? In terms of the comments I found a widget which simply disabled it for my pages.

    If you read carefully, I said it was where it was generated, not to remove it, you need to find and edit that function.

    Samara

    @blouishhotmailcom

    Ah I suppose I didn’t understand what you meant by edit. What exactly am I supposed to change the code to? I do not know php so I’m not sure how I am supposed to modify the function.

    could you copy the code from your functions.php to http://pastebin.com, it would most likely be in there.

    Samara

    @blouishhotmailcom

    http://pastebin.com/rVvFQtD2

    There you go, the functions.php I appreciate all the help you’ve been giving me. 🙂

    No worries about the help. I understand when you’re trying to do something it’s quite tough when you need to get up to speed, and it’s almost impossible to pick up PHP and WordPress straight away.

    So, on line 110:

    printf( __('<span class="meta-sep">by</span> %3$s <span class="%1$s">Posted on</span> %2$s', 'brunelleschi' ),

    I think this is the part of that line you will want to remove. Take a back up beforehand in case I’m wrong.

    <span class="meta-sep">by</span> %3$s

    Hope this is it!

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘[Resolved] Remove Author | Remove Comments’ is closed to new replies.
Skip to toolbar