The problem I now have is that the-excerpt-reloaded seems to fall over when encountering wordpress’s tags around images. The code appears as text in the post rather than being interpreted as it should be.
Is there a way so strip out or ignore these tags in my excerpts (ignoring anything in [] brackets would be fantastic if that’s possible?
The other alternative of course, would be if there’s another way to display images in my excerpts other than the_excerpt_reloaded.
Any help greatly appreciated…
Cheers
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php if (in_category('6')); ?>
<p class="subtitle"><?php the_title(); ?><p>
<?php the_excerpt_reloaded(120, '<a><img>', 'filter_type', TRUE, 'Read More', FALSE, 2, TRUE); ?>
<p class="postmetadata">Posted in <?php the_category(', '); ?></p>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
Also, using this code, how can I define how many excerpts I want to display?
Thanks in advance for answers to what I suspect are dumb questions…
]]>However, the fix_tags function does not work. The only tags I can allow are <img> and <object> because they are basically self-contained and will not be split by the end of the excerpt. Other tags (, ,
]]>, etc.) arde left hanging by the end of the excerpt. My pages do not validate and the italics or link etc. run on n to the following post excerpts.
My pages validate now because I only allow the <img> and <object> tags, but I would like to be able to us the others, too. Any solutions?
I have used the_excerpt_reloaded plugin. I’m working on the theme in a localhost environment, so I can’t show a link, but I’m using this idea, and trying to incorporate the-excerpt_reloaded plugin with it.
My theme is in the very basic state right now – I have only 3 calls in the stylesheet – so I know it’s not the stylesheet that’s messing with me. In fact, when I view the source code, the part that’s missing isn’t showing in the source code, either.
So here’s the thing – the “more” link isn’t showing on the site. The thing works just as it’s supposed to, but I can’t get the “more” to show up at the bottom of the excerpt. My code looks like so:
<?php if (have_posts()) : ?>
<?php query_posts("showposts=5"); ?>
<?php while (have_posts()) : the_post();
$postclass = ($post == $posts[0]) ? 'entry-1' : 'entry'; ?>
<div class="post<?php echo $postclass; ?>" id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<small><?php the_time('F jS, Y') ?></small>
<div class="entry">
<?php if ($postclass == "entry-1") { the_content('Read More »');}
else { the_excerpt_reloaded(50, '', '', TRUE, 'Read More »', TRUE); } ?>
</div>
I’ve even tried replacing that string with just “the_excerpt_reloaded();” to just go with the default settings, and still nothing shows up.
Would anyone know what I’ve missed? (because I *have* to have missed *something*!) Thanks
The plugin works fine on the full post, but it doesn’t show up on the main page. I noticed the script has this in the PHP code at the bottom:
// if you use the_excerpt or comment_excerpt please enable code below this
// i disable this because i dont use it on my template; and also sometime spoiler-tag doesnt complete.
//
//add_filter('the_excerpt', 'smart_spoiler_tag', 20);
//add_filter('comment_excerpt', 'smart_spoiler_tag', 20);
I use the_excerpt_reloaded. Could that be the problem? This is the code I use to get the_excerpt_reloaded to work:
<?php
if(is_single()) {
the_content();
} else {
the_excerpt_reloaded(100, '<a><img><b><i><ul><ol><li><h1><h2><h3><div><font><table>', 'excerpt', TRUE, '(More...)', FALSE, 1, TRUE);
}
?>
I’ve tried activating the add filter
line for ‘the_excerpt’, changing it to ‘the_excerpt_reloaded’, but that still doesn’t work. I really like this plugin on the full post. Can anyone help me to get it to work on the main page? Thanks.
<p>That apparently didnt help.</p>
<p>The only movie I could remember him in <br><span class="more-link"> <a href="https://nmallory.exit-23.net/20050815/christopher-who-is-running-for-president#more-389">.read more.</a></span><br>
<br>
</p><div class="alt">Linknotes:
<ol>
<li id="linknote-389-1"><a href="https://walken2008.com">Christopher Walken for President 2008</a> <a href="#noted-389-1"><strong>a??</strong>
BUT
w3.org says it looks like
<p>That apparently didn’t help.</p>
<p>The only movie I could remember him in <br /><span class="more-link"> <a href="https://nmallory.exit-23.net/20050815/christopher-who-is-running-for-president#more-389">.read more.</a></span><br />
<br />
<div class="alt">Linknotes:
<ol>
<li id="linknote-389-1"><a href="https://walken2008.com">Christopher Walken for President 2008</a> <a href="#noted-389-1"><strong>↩</strong></a></li></ol>
</div>
</p>
The error says that a <div>
can’t be placed there. I think that if the </p>
was there like in the viewed source, it would validate.
I’m using the_exerpt_reloaded and have <img>
defined in it…