?
Solved

Wordpress - remove metadata from Posts

Posted on 2011-02-22
9
Medium Priority
?
711 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1200 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
WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

 
LVL 14

Assisted Solution

by:Dzynit
Dzynit earned 1200 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 800 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 1200 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 800 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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
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…
Suggested Courses

777 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