[thelist] remove h1 line/entry

Simon MacDonald simonmacdonald at uk2.net
Sat Nov 20 02:38:32 CST 2010


Bob,

I clipped the following code out of the WP default template. 

Within the WP 'Loop' which displays content you usually get something like
below. The post title is displayed by the_title() function - which matches
up with the_content() of the post. You should have something similar in the
theme you are working on. Look at index.php, page.php, single.php - or just
pattern search all the files in the theme for the_title(), as there may be
subpage templates. 	

	<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
			<h2><?php the_title(); ?></h2>

			<div class="entry">
				<?php the_content('<p class="serif">Read the
rest of this entry &raquo;</p>'); ?>

				<?php wp_link_pages(array('before' =>
'<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' =>
'number')); ?>
				<?php the_tags( '<p>Tags: ', ', ', '</p>');
?>

HTH
Simon

-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Bob Meetin
Sent: 20 November 2010 4:57 AM
To: thelist at lists.evolt.org
Subject: Re: [thelist] remove h1 line/entry

>
>
> the_content() doesn't include the title of the post.  Is there is an
actual h1 in the content body itself you're trying to remove in this
instance
These last couple months have been a long decade.  The answer is yes.  
It's so lovely when you're trying to solve the wrong problem. I figured 
this out about an hour ago, sometime after I followed the link Meshack 
offered.  The purpose is to clean up duplication between what was 
defined as the page title and the h1 in the body.  Since the page title 
is linked I'm keeping that and will at leisure now dispose of the body h1's.

The cheap/dirty fix to make h1 disappear.

#hide_h1 { display:none; }

<div class="entry" id="hide_h1>
<?php the_content('<br />Read more &raquo;'); ?>
</div>

For what it's worth I can now mess up Wordpress with the best of em.

Thx, Bob
-- 

* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt ! 
 

__________ Information from ESET Smart Security, version of virus signature
database 5634 (20101119) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
 

__________ Information from ESET Smart Security, version of virus signature
database 5634 (20101119) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 



More information about the thelist mailing list