Solved

Wordpress - remove metadata from Posts

Posted on 2011-02-22
9
703 Views
Last Modified: 2012-05-11
Hi

I'm building a site for a business and need to remove the date, author, comment numbers, etc. from posts when they are displayed, as the posts dictate the images on the homepage (so they need to be present but not look like blog posts).

Can anyone tell me what I need to delete from single.php to prevent this metadata from being displayed?

(Can post the single.php if needed).

Thanks
0
Comment
Question by:CSHTech
  • 4
  • 3
  • 2
9 Comments
 

Author Comment

by:CSHTech
ID: 34954750
Code is: -

 get_header(); ?>

<div class="section-container clearfix">

<div class="<?php echo $layout;?> text">

	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
		
        <p class="breadcrumb"><?php the_breadcrumb(); ?></p>
                
		<h1 class="index-title"><?php the_title(); ?> <?php edit_post_link('Edit',' / ',''); ?></h1>        
            
        <div <?php post_class('section single') ?> id="post-<?php the_ID(); ?>">
    
            <ul class="meta">          
               <li class="meta-time"><?php the_time('F jS, Y') ?></li>
               <li class="meta-comment"><?php comments_popup_link('Leave a comment &#187;', 'One comment so far &#187;', '% comments &#187;'); ?></li>
            </ul>
            
            <?php the_content('Continue reading &raquo;'); ?>
	
			<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
        
            <div class="navigation clearfix">
                <div class="alignleft"><?php previous_post_link('<p>&laquo; Previous Post</p><p>%link</p>') ?></div>
                <div class="alignright"><?php next_post_link('<p>Next Post &raquo;</p><p>%link</p>') ?></div>
            </div>	
        
            <div id="comments" class="comments">
                <?php comments_template('/comments.php',true); ?>
            </div>
	
		</div><!--Post Ends -->
        
</div><!-- Layout Ends -->


<div class="aside aside-right-image-<?php echo $layout; ?>">
	<?php if ( has_post_thumbnail() ) { ?>
        <?php the_post_thumbnail('single-image'); ?>
    <?php } ?>
	<?php if (strlen($aboutpost) > 0) { ?><h3><?php echo $aboutpost; ?></h3> <?php } else { ?><h3>About this post</h3><?php } ?>	
		<ul>
        	<li class="meta-category">Posted in <?php the_category(', '); ?></li>
		   	<?php the_tags('<li class="meta-tag">Tags: ', ', ', '</li>'); ?>
		</ul>
</div>


<?php endwhile; endif; ?>

<?php get_sidebar(); ?>

</div>

<?php get_footer(); ?>

Open in new window

0
 
LVL 14

Accepted Solution

by:
Dzynit earned 300 total points
ID: 34954981
It's lines 15 through 18 that need removed, but on the homepage - you'll probably need to paste your index.php code here.

<ul class="meta">          
               <li class="meta-time"><?php the_time('F jS, Y') ?></li>
               <li class="meta-comment"><?php comments_popup_link('Leave a comment &#187;', 'One comment so far &#187;', '% comments &#187;'); ?></li>
            </ul>

Open in new window

0
 

Author Comment

by:CSHTech
ID: 34955211
Thank you. The metadata doesn't appear on the Homepage, so all good there. :)

I've made the change to single.php but when viewing the Post page, you can still see the path to the post above the post: -

Bartholomew » Uncategorized » Post 2

and
 
Previous Post, Next Post and  "comments are closed" caption, as attached screenshot.

Is this editable from single.php also? Screenshot of post area
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 14

Assisted Solution

by:Dzynit
Dzynit earned 300 total points
ID: 34955280
Yes, comments section is 24 to 27.

<div class="navigation clearfix">
                <div class="alignleft"><?php previous_post_link('<p>&laquo; Previous Post</p><p>%link</p>') ?></div>
                <div class="alignright"><?php next_post_link('<p>Next Post &raquo;</p><p>%link</p>') ?></div>
            </div>

Open in new window


The other is the breadcrumbs, line 9.

<p class="breadcrumb"><?php the_breadcrumb(); ?></p>

Open in new window


The breadcrumbs can be removed by deleting that line, but if you want to alter it - the real code would be in the functions.php file.
0
 
LVL 23

Assisted Solution

by:jeremyjared74
jeremyjared74 earned 200 total points
ID: 34955281
You could also display none using CSS to remove them on all pages posts and categories by adding this to your css
.entry-meta {
display: none !important;
}

Open in new window


You may need to change the selector for the meta. Here is another example:
.meta {
display: none !important;
}

Open in new window


And one more:
.postmeta {
display: none !important;
}

Open in new window


If you can't find your selector, send a link and I will help you.
0
 

Author Comment

by:CSHTech
ID: 34955361
Dzynit,

Deleted the code you advised and it's looking much better, thanks. The only thing left is the lower white area where it says 'comments are closed'. Any thoughts..?

(jeremyjared74: - many thanks for your input)
0
 
LVL 14

Assisted Solution

by:Dzynit
Dzynit earned 300 total points
ID: 34955531
That's lines 29 thru 31:


<div id="comments" class="comments">
                <?php comments_template('/comments.php',true); ?>
            </div>

Open in new window

0
 
LVL 23

Assisted Solution

by:jeremyjared74
jeremyjared74 earned 200 total points
ID: 34955568
You're welcome, but did you find it?

After looking at your code above I see you need to add this to the style.css:
.meta {
display: none !important;
}

Open in new window

0
 

Author Closing Comment

by:CSHTech
ID: 35093299
Many thanks for your help!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
limit a company to search only coupons for that particular company 6 30
IP 10.0.1.2 / 255.0.0.0 61 56
ajax to record click 3 16
Wordpress Hacked 1 20
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question