Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Comments, trackbacks & pings (http://forum.bytesforall.com/forumdisplay.php?f=19)
-   -   How do I eliminate comment ability for one post only? (http://forum.bytesforall.com/showthread.php?t=16623)

juliejulie Jan 27, 2012 08:11 PM

How do I eliminate comment ability for one post only?
 
I have multi-posts on my page. I'd like category/ratings/etc. for each post (which works now) BUT for the first post. I'd like the first post to show as a plain table (which is built) WITHOUT the comment/rating/etc. bar below it. But, I'd like the other posts below it to have that comment/rating/etc. bar.

Thanks in advance!

juggledad Jan 28, 2012 05:24 AM

assuming you mean you want the post footer removed for the first post on the page you have to know a little about the HTML format of a post and some CSS. Lesson time.

There is nothing that directly identifies the position of a post on the page. the posts are a just one avteg another like this
HTML Code:

<!-- Main Column -->
<td id="middle">
        <div class="post-6 post type-post odd" id="post-6">
                <div class="post-kicker">
                        blah blah
                </div>               
               
                <div class="post-headline">               
                        blah blah
                </div>                               
               
                <div class="post-bodycopy clearfix">
                        blah blah
                </div>                               

                <div class="post-footer">
                        blah blah
                </div>               
        </div><!-- / Post -->       
                               
        <div class="post-26 post type-post odd" id="post-26">
                <div class="post-kicker">
                        blah blah
                </div>               
               
                <div class="post-headline">               
                        blah blah
                </div>                               
               
                <div class="post-bodycopy clearfix">
                        blah blah
                </div>                               

                <div class="post-footer">
                        blah blah
                </div>               
        </div><!-- / Post -->       
</td>
<!-- / Main Column -->

depending on the options you have chosed and or plugins you have, there could be more DIVs in your case. there is no way to say 'don't display the post footer on the second post' however there is an interesting CSS Psuedo class called 'first-child'
Quote:

The :first-child selector is used to select the specified selector, only if it is the first child of its parent.
Notice that each post is made up of parts
HTML Code:

        <div class="post-6 post type-post odd" id="post-6">
                <div class="post-kicker">
                        blah blah
                </div>               
               
                <div class="post-headline">               
                        blah blah
                </div>                               
               
                <div class="post-bodycopy clearfix">
                        blah blah
                </div>                               

                <div class="post-footer">
                        blah blah
                </div>               
        </div><!-- / Post -->       

so you ccould say 'div.post div:first-child.....' and what that would do is effect the first DIV that is a child of the parent, so in this case it would effect the
HTML Code:

                <div class="post-kicker">
while that won't help, if you look again at the structure, teh posts are all in a 'td' and you want to effect the first one so you can start your selector with 'td#middle div:first-child....' and add what you need to remove the footer.

Homework: this should be enough to figure out the rest, so your homework is to show us the CSS that will "remove the post footer from the first post in the table column 'middle'".


All times are GMT -6. The time now is 09:12 AM.

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