WordPress.org

Ready to get started?Download WordPress

Forums

Remove Author, Date and Category from Posts (6 posts)

  1. comlight
    Member
    Posted 3 years ago #

    I'm using the Easel WP theme with 2 columns. I would like to remove the Author, Date and Category from all posts. I'm a total newbie at this so can someone please help me with what I need to do? The website is http://www.communitylighthouseministry.org.

    Thanks!

  2. illuminatus7
    Member
    Posted 3 years ago #

    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

    get_the_author()

    the_time()

    the_category

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

    E.G
    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

    http://codex.wordpress.org/The_Loop

  3. havardhedde
    Member
    Posted 3 years ago #

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

    <?php
    /**
     * 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: http://codex.wordpress.org/Template_Hierarchy
     *
     * @package WordPress
     * @subpackage Twenty_Ten
     * @since Twenty Ten 1.0
     */
    
    get_header(); ?>
    
    		<div id="container">
    			<div id="content" role="main">
    
    			<?php
    			/* 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:
    get_the_author()
    the_time()
    the_category

    Anyone who knows what's gone wrong?

  4. Bhiroe
    Member
    Posted 3 years ago #

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

    <?php
    /*
    Template Name: Blank Template
    */
    get_header();
    
    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>
    				<div class="clear"></div>
    				<div class="entry">
    					<?php easel_display_the_content(); ?>
    					<div class="clear"></div>
    				</div>
    				<div class="clear"></div>
    				<?php edit_post_link(__('Edit this page.','easel'), '', ''); ?>
    			</div>
    			<div class="post-foot"><?php do_action('easel-post-foot'); ?></div>
    		</div>
    	<?php endwhile;
    	if ($post->comment_status == 'open') {
    		comments_template('', true);
    	}
    }
    
    get_footer();
    ?>
  5. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

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

    remove:

    <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.

    @Bhiroe
    the last question was not about the theme 'easel'

  6. laptophobo
    Member
    Posted 2 years ago #

    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}

Topic Closed

This topic has been closed to new replies.

About this Topic