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)
-   -   <!--nextpage--> destroys excerpt (http://forum.bytesforall.com/showthread.php?t=16709)

esel Feb 7, 2012 07:20 PM

<!--nextpage--> destroys excerpt
 
Hey,

always if i try to split posts with nextpage the excerpt length on homepage will be augmented till the nextpage tag (without my ATA customized 100 words limit), additionally images are no longer stripped out. What am i doing wrong? Thank you. Using atahualpa 3.7.3, but have the problem since 3.6.1.

lmilesw Feb 7, 2012 08:15 PM

I'm not real clear on what you are describing but when I put a next page tag in a post I initially see the excerpt on the multi post page and then when I open the post I see the text to the first next tag.

esel Feb 8, 2012 07:46 AM

No, on multipost i see text till nextpage, otherwise it would be fine lol...

lmilesw Feb 8, 2012 08:05 AM

If your next tag is placed before where you have your excerpt length set to you may see it. You can always use manual excerpts to "force" an excerpt.

Actually I am still having a hard time understanding what you are doing. Could you do the following?

- What is your excerpt length?
- Is the multi-post page set to excerpts only?
- Where is your next tag placed?
- Could you paste an example of the content of a post here?

esel Feb 8, 2012 08:31 AM

Thanks a lot for your attention.
- What is your excerpt length?

I put it to 100 words

- Is the multi-post page set to excerpts only?

Yes it is, and if i do not use nextpage tag it shows excerpt as configured

- Where is your next tag placed?

Much later than 100 words. So excerpt will be blown up till the nextpage tag including all images that normally are stripped out.

- Could you paste an example of the content of a post here?

Right now i dont use nextpage tag, because it makes my home/multipostpages look like shi...
What exactly do you mean with posting example? That i copy the post out of html view in editor and paste it here? Or copy from browser?

lmilesw Feb 8, 2012 08:44 AM

The way excerpts, next page tag, etc all work together can be "interesting". The best way to have an excerpt display exactly as you want it is to use manual excerpts.

esel Feb 8, 2012 08:49 AM

Ah, ok. Can you give me a link where i am told how to do that?
Thanks.

esel Feb 8, 2012 08:54 AM

Oh alright, you mean that box below the post editor. Ok, i try that out, but that would mean that i will have to perform quite some clicks to get all may excerpts done, holy crap!

esel Feb 8, 2012 09:15 AM

Like that it would work. But now i have to tell wp to give me back my h3 tags for excerpt. thats how i found this:

HTML Code:

remove_filter('get_the_excerpt', 'wp_trim_excerpt');
add_filter('get_the_excerpt', 'replacement_custom_trim_excerpt');

function replacement_custom_trim_excerpt($text) {
        $raw_excerpt = $text;
        if ( '' == $text ) {
                $text = get_the_content('');

                $text = strip_shortcodes( $text );

                $text = apply_filters('the_content', $text);
                $text = str_replace(']]>', ']]>', $text);
                $text = strip_tags($text, '<h3>');
                $excerpt_length = apply_filters('excerpt_length', 100);
                $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');
                $words = preg_split("/[\n\r\t ]+/", $text, $excerpt_length + 1, PREG_SPLIT_NO_EMPTY);
                if ( count($words) > $excerpt_length ) {
                        array_pop($words);
                        $text = implode(' ', $words);
                        $text = $text . $excerpt_more;
                } else {
                        $text = implode(' ', $words);
                }
        }
        return apply_filters('replacement_wp_trim_excerpt', $text, $raw_excerpt);
}*

Can i use that in my functions.php instead of what athualpa writes there?
Do i have to name the replacment function like the ata function?
Or will it break atahualpa or do the same error as before?

lmilesw Feb 8, 2012 11:04 AM

I guess I am still not understanding what your problem is. Here is what it seems like you are doing.
  • Show excerpts is set to yes
  • Excerpt length is set to 100
  • The next page tag (<!--nextpage-->) is placed in the text past the 100 work point
  • You now say the excerpt goes to where the nextpage tag was placed
If those are accurate we get different results. If I place the nextpage tag past where the excerpt length is set the 100 word excerpt length is what I see on my multipost page and when I open the post I will see the page numbers at the bottom.


If my description is accurate you may want to try deactivating your plugins to see if one of them is causing an issue.

esel Feb 8, 2012 12:02 PM

It is exactly like that. Already started manually creating excerpts for pages where i need nextpage. i will do the plugin test another day, for today i clicked enough. But thank you.


All times are GMT -6. The time now is 12:32 PM.

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