Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Excerpts, Read more, Pagination (http://forum.bytesforall.com/forumdisplay.php?f=20)
-   -   [SOLVED] How to display excerpts inside tables? (http://forum.bytesforall.com/showthread.php?t=4767)

JFG Dec 8, 2009 08:19 AM

[SOLVED] How to display excerpts inside tables?
 
Hi,

I would like to display each excerpt on multiple-post pages (including post title and excerpt) inside individual tables on which I would put a border. Anyone know how I can do this?

And I would like to make the text in the excerpts justified.

Thanks for any input...

JFG

juggledad Dec 8, 2009 08:55 AM

you can style the post container. each post sits inside a post container and they all sit inside the center column - see http://callofthemuse.com/ for an example. In this case I have the first post full and the rest excerpts, but each in their own box

Is this what you are looking for?

JFG Dec 8, 2009 10:50 AM

Yes! This is exactly what I want to do. I added the border I wanted in the post container. But now I have another problem... it also adds them on the pages but I only want this to affect posts. How would I go about it?

And while I'm at it... how would I only add the borders to the excerpts and not the posts themselves?

Many thanks!

JFG

juggledad Dec 8, 2009 11:23 AM

hmmm, see pages are actually a special kind of post. you will have to do some CSS Inserts the backout the changes for pages you can use 'body.page' to identify the 'page' pages vrs the multi-post or single-post pages (body.blog and body.single)

to see what CSS you need to change, set the color to 123456, then view the source and search for 123456. You should see teh CSS you need to 'reverse'.

JFG Dec 8, 2009 11:47 AM

Well, I don't understand what you just explained. Would it be more simple to have just the excerpts show up with the border on the container - or is the same container as the posts and pages in the code as well?

juggledad Dec 8, 2009 11:50 AM

It's the same container. What you want to do is doable, it will just take some CSS Inserts. You will have to look at how the container is stled now, then create CSS Inserts for the way you want it to be different. By using the 'body.xxxxx' selector, you can direct the new CSS to just certian types of pages.

JFG Dec 8, 2009 12:12 PM

Ok...

I've found this in the source code for the page:

div.post,div.page{display:block;margin:0 0 30px 0;border:solid 1px #123456;padding:15px;-moz-border-radius:10px}

So I tried to add this into the css insert (bolded text is what I changed):

.div.post,body.page{display:block;margin:0 0 30px 0;border:solid 0px #123456;padding:15px;-moz-border-radius:10px;}

...but it's not working :o

juggledad Dec 8, 2009 02:08 PM

yeah that wouldn't work since the 'div.post in inside the body.page try this
HTML Code:

body.page div.post, body.page {
  display:block;
  margin:0 0 30px 0;
  border:solid 0px #123456;
  padding:15px;
  -moz-border-radius: 10px;
}


JFG Dec 8, 2009 08:24 PM

It has worked! Thank you! ;)

I've added a second section of code using the body.single to remove the border around the single post pages and I only have it around the excerpts like I want.

Except that it is still showing on full posts appearing on multi-post pages. On my home page there's a full post (followed by a bunch of excerpts), and I would like to remove the border on that full post. Is there an identifier for full posts on multi-post pages that would allow me to use the code above to strip them of the borders as well?

The end goal is to have borders only on excerpts.

Again, thank you so much for your help!

juggledad Dec 9, 2009 06:32 AM

There is currently nothing built in to let you know if a post is an excerpt or not. you could change the code - you will have to do this on every upgrade.

Edit bfa_post_parts.php and change lines 108-128 (version 3.4.4) from
HTML Code:

function bfa_post_bodycopy($before = '<div class="post-bodycopy clearfix">', $after = '</div>') {
       
        global $bfa_ata, $post;
       
        echo $before;
        if ( (is_home() AND $bfa_ata['excerpts_home'] == "Full Posts") OR
        (is_category() AND $bfa_ata['excerpts_category'] == "Full Posts") OR
        (is_date() AND $bfa_ata['excerpts_archive'] == "Full Posts") OR
        (is_tag() AND $bfa_ata['excerpts_tag'] == "Full Posts") OR
        (is_search() AND $bfa_ata['excerpts_search'] == "Full Posts") OR
        (is_author() AND $bfa_ata['excerpts_author'] == "Full Posts") OR
        is_single() OR is_page() OR
        (is_home() AND !is_paged() AND $bfa_ata['postcount'] <= $bfa_ata['full_posts_homepage']) ) {
                $bfa_ata_more_tag_final = str_replace("%post-title%", the_title('', '', false), $bfa_ata['more_tag']);
                the_content($bfa_ata_more_tag_final);
        } else {
                the_excerpt();
        }
        echo $after;
       
}

to
HTML Code:

function bfa_post_bodycopy($before = '<div class="post-bodycopy clearfix">', $after = '</div>') {
       
        global $bfa_ata, $post;
       
        if ( (is_home() AND $bfa_ata['excerpts_home'] == "Full Posts") OR
        (is_category() AND $bfa_ata['excerpts_category'] == "Full Posts") OR
        (is_date() AND $bfa_ata['excerpts_archive'] == "Full Posts") OR
        (is_tag() AND $bfa_ata['excerpts_tag'] == "Full Posts") OR
        (is_search() AND $bfa_ata['excerpts_search'] == "Full Posts") OR
        (is_author() AND $bfa_ata['excerpts_author'] == "Full Posts") OR
        is_single() OR is_page() OR
        (is_home() AND !is_paged() AND $bfa_ata['postcount'] <= $bfa_ata['full_posts_homepage']) ) {
                echo $before;
                $bfa_ata_more_tag_final = str_replace("%post-title%", the_title('', '', false), $bfa_ata['more_tag']);
                the_content($bfa_ata_more_tag_final);
        } else {
        $before = '<div class="post-bodycopy clearfix post-is-excerpt">';
        echo $before;
                the_excerpt();
        }
        echo $after;
       
}

HOWEVER, this will only effect the body of the post ie if you use the new class 'post-is-excerpt' to add a border, it will only go around teh body of the post, not the whole post.

JFG Dec 14, 2009 01:19 PM

Curiously, this code :

body.page div.post, body.page {
display:block;
margin:0 0 30px 0;
border:solid 0px #123456;
padding:15px;
-moz-border-radius: 10px;
}

... removed the space above and below the layout.

I've modified my design to accomodate borders on the posts and pages too. Thank you for your help!

juggledad Dec 14, 2009 01:24 PM

Yes that will work, but it won't differentiate between full poses and excertps.


All times are GMT -6. The time now is 10:54 PM.

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