Edit your theme’s templates files to use the post_class function instead of hard coding the classes ‘post’ and ‘page’. Then style all posts and pages using the generated .hentry class.
Sounds like I’m way over my head. Reading through post_class function didn’t enlighten me. I get the very rough idea, but I don’t know where to find the place in my style sheet – if it is in my style sheet at all. In Page.php, for example (one of the files the codes says I could use this template tag in) I see code about “post” but nothing that says “page” `<div id=”content” class=”narrowcolumn”>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class=”post_class” id=”post-<?php the_ID(); ?>”>
<h2 class=”page_title”><?php the_title(); ?></h2>`
I can’t figure out how it’s using one style sheet to call up two different styles-but maybe that’s normal. In short, I would need to figure out what take out in order to figure out where to put that in, wouldn’t I? I tried putting the class="post_class"
tag in the one place I found class=page, but to no avail.
I think I said it in the first sentence, but I have not being able to figure things out π
Try using <div <?php post_class();?> id="post-<?php the_ID(); ?>">
In place of <div class="post_class" id="post-<?php the_ID(); ?>">
?
I’m still not seeing any evidence of the post_class() on your Home page. You need to use:
<div <?php post_class();?> id="post-<?php the_ID();?>">
I’ve figured out where in the style sheet this happens. In
#board_sub{
width:100%;
height:14px;
overflow:hidden;
background:url(images/bgr_board_sub.png) no-repeat;
I changed the image to match the image on the blog/post pages and it worked. Now all I have to do is figure out where to change the spacing so the picture actually fits and I’m golden. Maybe.
YES!!!! I did it! it’s all in that “Board” code. I had to make the board_sub match the 1st board on the list.
Thanks for your help.
You weren’t seeing <div <?php post_class();?> id="post-<?php the_ID();?>">
because I removed it when it didn’t work. It’s undoubtedly the better way to do it, but since I’ve got this version working…why mess with success, right? π
Oh – I’m a big fan of If It Ain’t Broke, Don’t Fix It. π
Where is the styling for <div <?php post_class();?> id="post-<?php the_ID();?>">
? I don’t want it centered and would like to maybe make other tweaks. Is there a hidden style sheet?
To be more specific, that line puts a heading and the details out there but I want to style just the heading. Where is that magic place? If I add a line to style.css what might it look like?
that line just outputs the opening div for the post, with a lot of css classes;
you would also need to know the html tag of your heading (h2
, or h3
or..?) and if it is linked or not.
for a list of (possible) post_class css class output, see:
http://codex.wordpress.org/Function_Reference/post_class
a line for this style.css might look like:
.hentry h2 { color: green; }
or
.hentry h2 a { color: #123edf; }
(or it could look totally different; details depend on your theme)
http://www.w3schools.com/css/