Jump to content

help needed with assigning classes and CSS for posts in Wordpress


sansaraoff

Recommended Posts

Not sure if anyone can help here but who knows ::) that must be easy for an experienced programmers but not for me :shrug:

 

My plan is to create the posts category with the post being inserted into the accordion. That's the library I want to use:

 

http://flowplayer.org/tools/demos/tabs/accordion.html

 

So In order to complete that I gotta use the same kind of HTML styling of my posts by making the latest post with class "current" as you can see from this HTML:

 

<div id="accordion">

 

<h2 class="current">First pane</h2>

<div class="pane" style="display:block">... pane content ...</div>

 

<h2>Second pane</h2>

<div class="pane">... pane content ...</div>

 

<h2>Third pane</h2>

<div class="pane">... pane content ...</div>

 

</div>

 

I found the great tutorial on how to assign the unique class to the latest post:

 

http://adambrown.info/b/widgets/easy-php-tutorial-for-wordpress-users/first-post-different-from-the-rest/

 

and now my aim is to assign class "current" to H3 tag and style="display: block" for the underlying div container for this chunk of code:

 

<?php while (have_posts()) : the_post(); ?>

<div <?php post_class() ?>>

<h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>

<small><?php the_time('l, F jS, Y') ?></small>

<div class="blog-entry">

<?php the_content() ?>

</div>

</div>

 

<?php endwhile; ?>

 

i hope that makes sense and any advise will be much appreciated! it's kinda big deal for me as I work by myself and client awaits :-\

 

thanks for your time! :P

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.