Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages » Excerpts, Read more, Pagination »

Tables break the layout.


  #1  
Old Feb 1, 2010, 05:26 AM
djberriman
 
8 posts · Jan 2010
Tables break the layout.

If a table is included in a post then when excerpts are listed in the home page, the table formatting is removed and you just get the data listed vertically which looks a mess.

I added the table/tbody/tr/td so that they are not stripped out and that works to an extent, except that sometimes the full table is included in the excerpt and sometimes its not, it doesn't appear to be at the correct number of excerpt bytes but some arbitrary place. When the full table is not output then the whole layout is corrupted as the table is not closed and the rest of the output appears as part of the table. Really I guess the code should include the full table and not break it half way once it has started output.

I also tried using the read more tag in the post to stop the table being included in the excerpt, this works but there is a bug/feature in that the read more tab is not included after except, it would appear this is because if there is not much text before that table. The code should honour the fact it has seen a read more tag and add a read more tag to the excerpt regardless of the amount of data put in the excerpt.

Any thoughts on how I might solve these issues, any chance of fixing the read more issue?

Duncan
  #2  
Old Feb 1, 2010, 05:41 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
what version of Atahualpa and WP?
Did you look at http://forum.bytesforall.com/showthread.php?t=3377
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Feb 3, 2010, 05:16 AM
djberriman
 
8 posts · Jan 2010
Wordpress Version 2.9.1
Atahualpa 3.4.5.1

Regards
Duncan
  #4  
Old Feb 3, 2010, 07:21 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
and did you look at the post?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Feb 4, 2010, 03:13 AM
djberriman
 
8 posts · Jan 2010
I did look at the post but it doesn't seem relevant. I am using method 2.

This is a different issue to do with tables.

If tables are used then the excerpt ends up a mess as you just send up with lines and lines of data one after another as the tags are stripped out.

If you stick a more tag into prevent this, there is no read more on the excerpt to entice the visitor to see the table/content.

If you tell it not to strip table, tr and td then it breaks at some point in the table and then the whole page layout is broken as there is no closing table tag.

It appears from what you are saying is I could manually add an excerpt and then 'fix' the read more code.

It would be better if we could fix the problem as its very likely to confuse others too.

All it really needs to do is honour the more tag that has been placed in the page and that will solve the issue. Not sure if thats a wordpress or a template issue.

I might have a play and see if I can fix the code
  #6  
Old Feb 4, 2010, 03:47 AM
djberriman
 
8 posts · Jan 2010
This appears to solve the issue for tables....

PHP Code:
// Custom Excerpts 
function bfa_wp_trim_excerpt($text) { // Fakes an excerpt if needed
    
    
global $bfa_ata;
    
$addmore 0;

    if ( 
'' == $text ) {
        
$text get_the_content('');
        
// tables break layout so don't display in excerpt
        // force read more as there is more to read
        
$addmore strpos($text,'<table');
        if (
$addmore !== false) {
            if (
$addmore 0)  {
                
$text substr($text0$addmore 1); 
            }
            else {
                
$text '';
            }
        } 
        
$text apply_filters('the_content'$text);
        
$text str_replace(']]>'']]>'$text);
        
$text strip_tags($text$bfa_ata['dont_strip_excerpts']);
        
$excerpt_length $bfa_ata['excerpt_length'];
        
$words explode(' '$text$excerpt_length 1);
    } else {
        
$words explode(' '$text);
    }

    if (
count($words) > $excerpt_length || $addmore) {    
        if (
count($words) > $excerpt_length) {
            
array_pop($words);
        }    
        
$custom_read_more str_replace('%permalink%'get_permalink(), $bfa_ata['custom_read_more']);
        
$custom_read_more str_replace('%title%'the_title('','',FALSE), $custom_read_more);
        
array_push($words$custom_read_more);
        
$text implode(' '$words);
    }

    return 
$text;

I did try to scan for the read more tag but I think it is stripped before calling this function.

Duncan

Last edited by djberriman; Feb 4, 2010 at 04:27 AM.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Footer: How to add line break in footer text StudioGal Post-Kicker, -Byline & -Footer 2 Oct 9, 2009 06:41 AM
[SOLVED] Layout WIDTH vs. Layout Container Olivier Header configuration & styling 2 Jul 13, 2009 06:18 PM
Using tables??? jim Excerpts, Read more, Pagination 1 Jun 4, 2009 06:04 PM
Using tables Ron Atahualpa 3 Wordpress theme 20 Mar 29, 2009 03:11 PM
Update to latest version - will it break? bergonzzi New Versions, & Updating 1 Jan 28, 2009 04:21 PM


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


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