kappaluppa
Member
Posted 5 years ago #
This is the page I'm working on: http://asplashofcoloronline.com/category/tips/
It seems that the the_excerpt tag adds <p> </p> in the excerpt. I want to take that out. And I want to add an indent. I've tried doing it with css, but to no avail.
So I'm looking for where the function is and maybe I can adjust it there.
BTW,
here is the css I tried. Maybe I goofed that up:
.moveupandover {
margin: -15px 0 0 15px;
}
<span class="moveupandover"><?php the_excerpt(); ?></span>
========
thanks,
K
<?php
/*
Plugin Name: No Excerpt-P
Description: Removes the paragraph tags from the output returned by the_excerpt() function
Version: 1.0
Author: Amit Gupta
Author URI: http://blog.igeek.info/
*/
remove_filter('the_excerpt', 'wpautop');
?>
Just copy all that into a text file, rename it blah.php and upload it to your plugins folder. Activate it, and youre done.
kappaluppa
Member
Posted 5 years ago #
FANTASTIC! Works like a charm!
thanks for the quick response!
K
kappaluppa
Member
Posted 5 years ago #
Another question...
how to change the [...] to "Read More..." or some such?
auschick
Member
Posted 4 years ago #
Sweet! I had the same problem and that fixed it :-).
@Kappuluppa: one thing you can do is go back through your posts and fill in the "optional excerpt" bit at the bottom of the write post admin panel. WordPress will use this excerpt rather than the generated one.
This is what my template looks like:
<?php the_excerpt(); ?><span class="readmore"><a href="<?php the_permalink ?>">Read This</a></span>
natalie
Member
Posted 4 years ago #
NOTE: You don't actually need to make a plugin for this. It will work simply by adding the code anywhere on your page... <?php remove_filter('the_excerpt', 'wpautop'); ?>
The code can also be placed in the functions.php file.
Thanks for this solution anyway, it took me a while to find it.
Thanks for that line of code !
I got close to crazy with trying to validate my tamplate...