WordPress.org

Ready to get started?Download WordPress

Forums

How to remove author from post (Magazine theme)? (3 posts)

  1. fjforall
    Member
    Posted 4 years ago #

    Hi, I have managed to removed the text saying that there are no comments from my the pages where users cannot comment (I am using the Magazine theme). However, I cannot find a way to remove the author of the posts (it is always going to be me and I do not want it to look like a blog).

    I would really appreciate it if anyone could give me a clue on how to do it?
    This is the code for comments.php:

    <div id="comments">
    <?php if ( post_password_required() ) : ?>
    				<div class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'magazine-basic' ); ?></div>
    			</div><!-- .comments -->
    <?php
    		return;
    	endif;
    ?>
    
    <?php
    	// You can start editing here -- including this comment!
    ?>
    
    <?php if ( have_comments() ) : ?>
    			<h3 id="comments-title">
    <?php
        printf( _n( 'One Response to %2$s', '%1$s Responses to %2$s', get_comments_number(), 'magazine-basic' ),
            number_format_i18n( get_comments_number() ), '<em>' . get_the_title() . '</em>' );
    ?>
                </h3>
    
    <?php if ( get_comment_pages_count() > 1 ) : // are there comments to navigate through ?>
    			<div class="navigation">
    				<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'magazine-basic' ) ); ?></div>
    				<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'magazine-basic' ) ); ?></div>
    			</div>
    <?php endif; // check for comment navigation ?>
    
    			<ol class="commentlist">
    				<?php wp_list_comments( array( 'callback' => 'mytheme_comment' ) ); ?>
    			</ol>
    
    <?php if ( get_comment_pages_count() > 1 ) : // are there comments to navigate through ?>
    			<div class="navigation">
    				<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'magazine-basic' ) ); ?></div>
    				<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'magazine-basic' ) ); ?></div>
    			</div>
    <?php endif; // check for comment navigation ?>
    
    <?php else : // this is displayed if there are no comments so far ?>
    
    <?php if ( comments_open() ) : // If comments are open, but there are no comments ?>
    
    <?php else : // if comments are closed ?>
    
    		<!--<p class="nocomments"><?php _e( 'Comments are closed.', 'magazine-basic' ); ?></p>-->
    
    <?php endif; ?>
    <?php endif; ?>
    
    <?php
    $args = array(
    	'comment_notes_after' => '',
    	'comment_field' => '<p class="comment-form-comment"><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>'
    );
    comment_form($args); ?>
    
    </div><!-- #comments -->

    Here is the code for index.php:

    <?php get_header(); ?>
    	<?php
    	$options = get_option("widget_sideFeature");
        $posts = theme_option('number_posts');
        $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
        if (is_active_widget('widget_myFeature')) {
            $args = array(
               'cat'=>'-'.$options['category'],
               'posts_per_page'=>$posts,
               'paged'=>$paged,
               );
        } else {
            $args = array(
               'posts_per_page'=>$posts,
               'paged'=>$paged,
               );
        }
    	if(!theme_option('number_posts')) {
            $args = array(
               'posts_per_page'=>6,
               'paged'=>$paged,
               );
    	}
        $x = 1;
        query_posts($args);
        ?>
        <?php
    	if(is_front_page() && $paged < 2) {
    		if(theme_option('latest_story')=="on") { echo '<h5 class="latest">'.__('Latest Story', "magazine-basic").'</h5>'; }
    		$optionlayout = "option".theme_option('post_layout');
    		if($optionlayout) {
    			include (TEMPLATEPATH.'/layout/'.$optionlayout.'.php');
    		} else {
    			include (TEMPLATEPATH.'/layout/option3.php');
    		}
    	} else {
    		include (TEMPLATEPATH.'/layout/option1.php');
    	}
        ?>
    	<?php
        if(function_exists('pagination')) { pagination(); }
        ?>
    <?php get_footer(); ?>

    And the code for single.php:

    <?php get_header(); ?>
    	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    			<h1><?php the_title(); ?></h1>
    			<div class="meta">
    				<?php if(theme_option('dates_posts')=='on') { echo '<div class="date">'; the_time(get_option('date_format')); echo '</div>'; } ?>
    
                    <?php if(theme_option('authors_posts')=='on') { _e("By", "magazine-basic"); echo ' '; the_author_posts_link(); } ?>
    
    			</div>
    			<div class="entry">
    				<?php $subtitle = get_post_meta($post->ID, 'subtitle', true);
    					if($subtitle) echo '<p class="sub">'.$subtitle.'</p>';
    				 ?>
    				 <?php the_content(); ?>
    				<?php the_tags(__('<p class="tags"><small>Tags: ', "magazine-basic"), ', ', '</small></p>'); ?>
                </div>
      		<?php wp_link_pages(array('before' => '<p><strong>'.__('Pages', "magazine-basic").'</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    		</div>
    
    	<?php comments_template(); ?>
    	<?php endwhile; else: ?>
    		<p><?php _e("Sorry, no posts matched your criteria.", "magazine-basic"); ?></p>
    <?php endif; ?>
    <?php get_footer(); ?>

    I tried by deleting <?php if(theme_option('authors_posts')=='on') { _e("By", "magazine-basic"); echo ' '; the_author_posts_link(); } ?> from single.php, but it did not work. It still keeps on showing the name of the author, the only thing that has changed is that clicking on the name on the author will not work. I want to keep the date though.

    Thanks!

  2. fjforall
    Member
    Posted 4 years ago #

    I mean, I want to get to rid of the whole thing of "By 'author'"... :(

  3. David Shabtai
    Member
    Posted 3 years ago #

    I can't answer directly about the theme, but I can suggest another solution, for anyone who wants a little more flexibility:

    I wrote a plugin called Post Author, and it lets you dynamically add to a post, a page, excerpts on categories/list and home, the credits: author, date, link to author bio page, avatar, revision/modification date... all fully customizable and optional.

    Regardless of your theme, you can now automatically reference the author of an article plus you can specifically hide authorship on a particular post or page.

    Hope this helps anyone trying to manage multiple author blogs or news / editorial websites.

    David.

Topic Closed

This topic has been closed to new replies.

About this Topic