Support » Themes and Templates » Remove Author, Date and Category from Posts

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi!!!
    There is a fairly simple way. If you only want to remove Author, Date and Category from the posts that are displayed on the home page, then you will have to make some changes into the index.php in your theme folder.

    1) Open your theme folder (located in wp-content\themes\your theme name)
    2) Locate the index.php file. Create a backup and then edit the original file. In case something goes wrong, you can always restore the original file.
    3) Open the original index.php and locate the following functions




    4) Comment out the function lines and the markup from where it is getting generated.

    If it is something like this
    <h2><?php printf( esc_attr__( 'About %s', 'twentyten' ), get_the_author() ); ?></h2>
    then turn it into this
    <!--<h2><?php //printf( esc_attr__( 'About %s', 'twentyten' ), get_the_author() ); ?></h2>-->

    If you are not getting the idea, then please go through this

    Hmmm. This looks like a good method. But my index.php file looks like this (also twenty ten).

     * The main template file.
     * This is the most generic template file in a WordPress theme
     * and one of the two required files for a theme (the other being style.css).
     * It is used to display a page when nothing more specific matches a query.
     * E.g., it puts together the home page when no home.php file exists.
     * Learn more:
     * @package WordPress
     * @subpackage Twenty_Ten
     * @since Twenty Ten 1.0
    get_header(); ?>
    		<div id="container">
    			<div id="content" role="main">
    			/* Run the loop to output the posts.
    			 * If you want to overload this in a child theme then include a file
    			 * called loop-index.php and that will be used instead.
    			 get_template_part( 'loop', 'index' );
    			</div><!-- #content -->
    		</div><!-- #container -->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    I can’t find these lines:

    Anyone who knows what’s gone wrong?

    open your template.php and then replace it with the following code:

    Template Name: Blank Template
    if (have_posts()) {
    	while (have_posts()) : the_post(); ?>
    		<div <?php post_class(); ?>>
    			<?php easel_display_post_thumbnail(); ?>
    			<div class="post-head"><?php do_action('easel-post-head'); ?></div>
    			<div class="post-content">
    					<div class="post-text">
    						<?php easel_display_post_title(); ?>
    				<div class="clear"></div>
    				<div class="entry">
    					<?php easel_display_the_content(); ?>
    					<div class="clear"></div>
    				<div class="clear"></div>
    				<?php edit_post_link(__('Edit this page.','easel'), '', ''); ?>
    			<div class="post-foot"><?php do_action('easel-post-foot'); ?></div>
    	<?php endwhile;
    	if ($post->comment_status == 'open') {
    		comments_template('', true);



    Forum Moderator

    look into loop.php (for the front page and archive pages) and into loop-single.php (for single posts);


    <div class="entry-meta">
    		<?php twentyten_posted_on(); ?>
    	</div><!-- .entry-meta -->

    from these templates;
    or, as these templates are using a function in functions.php of twenty ten:
    function twentyten_posted_on()
    edit this function and remove what you don’t want.

    the last question was not about the theme ‘easel’

    One easy option, which doesn’t require going into any of the template pages, is to simply hide that meta (author, date, category info) by creating the following style in .entry-meta of the style sheet:

    display: none

    For example, if you want to hide the entry meta only in the single.php template, then something like this should work:

    body.single .entry-meta {display: none}

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Remove Author, Date and Category from Posts’ is closed to new replies.