Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Center area post/pages (http://forum.bytesforall.com/forumdisplay.php?f=32)
-   -   Change background color first post (http://forum.bytesforall.com/showthread.php?t=11012)

zeolan Nov 6, 2010 10:27 AM

Change background color first post
 
I wanna change the colour only for my first post.
I think i do on the loop, but i dont know how.

Thank u for the answers.

juggledad Nov 6, 2010 03:37 PM

look at the documentation at ato->Style & edit CENTER COLUMN-The LOOP and you will see how to set up a test for the post count. Us ing his, you could add a <div ID="first_post"> and a </div> around the post parts and then add CSS to style the background.

zeolan Nov 7, 2010 07:56 AM

Sorry, but i don't understand where i can put <div..
i try do some like this.. but dosen't work :(

Quote:

......<?php /* Post Container starts here */
if ( function_exists('post_class') ) { ?>

<div <?php if ( is_front_page() AND $bfa_ata['postcount'] == 1 ) { ?> class="first_post">
<?php } ?></div>


<div <?php if ( is_page() ) { post_class('post'); } else { post_class("$odd_or_even"); } ?> id="post-<?php the_ID(); ?>" >
<?php } else { ?>........

juggledad Nov 22, 2010 03:28 AM

When you want to get into specific changes like this, you need to know some PHP and HTML and how they interact. You should wrap the entire contents of "the LOOP' in the DIV, so you have to test for the first post, put in the div at the top, then at the bottom, test again for the first post and add the closing DIV html.

And don't double post


All times are GMT -6. The time now is 02:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.