Hi, my name is Pascal and I am a SAP & Supply Chain specialist. I work for PLAUT and I do things others can't.
This blog only contains my personal views, thoughts and opinions. It is not endorsed by my employer nor does it constitute any official communication of PLAUT. You can contact me via email at pascal[at]renet-web.net or use the contact form that you will find by following the 'Contact' link and you can follow me on twitter here.
Posted on May 8, 2006 | Category: Wordpress
In WordPress (at least as far as I know – please correct me if I’m wrong) there are two functions that allow you to output your post content.
These functions are:
As you will have noticed I use both these functions here at renet@web. I use the_content to output the latest post and then the_excerpt to display the next 4 posts.
There are two things that I never liked with the function the_excerpt:
But despair no more, thanks to John Wrana a cure is at hand and in fact full credits are given to him for coming up with this trick of sorts. I should also warn you that if you do not understand what is indicated below, then you should not attempt to do this at home (then again maybe it’s my accent that makes it hard to understand) – this implies changing standard WordPress files – proceed at your own risk.
My comprehension of German is a bit dodgy (haven’t been using it for quite some time), but what I could make in John’s post is that we need to change a bit of code in the file functions-formatting.php which you should find in the wp-includes folder of your WordPress installation. What you need to do is to, in that file find the function
d3BfdHJpbV9leGNlcnB0KCk6
.
Bearing in mind what I said above, in that function I changed two things:
JGV4Y2VycHRfbGVuZ3RoID0gNTU7
YXJyYXlfcHVzaCgkd29yZHMsICdbLi4uXScpOw==
Before, I press this post, I should also point out that Chris J. Davis has written a wonderful post where he explains how to customize post excerpt using a more sophisticated method.
» Filed Under Wordpress
May 8th, 2006 at 4:10 pm
Or you could write an excerpt ;)
I’m doing it the hard way. Using the
thing, and custom fields to achieve the effect so certain templates recognize different content. This way seems a lot easier, but it cuts off words.
May 8th, 2006 at 7:53 pm
Oliver, how are you going to do it? I mean is it going to be in the form of a plugin or are you going to hack the wordpress code? Sounds promising.
May 9th, 2006 at 3:39 am
I have the “” at the end of where I want it in a post, and if indeed a post is long and needs to be shortened, it’s given a custom field as well. That way, the templates can recognize when to display the whole post or just everything before , based on the custom field.
It’s kind of tedius, but I don’t mind :)
May 23rd, 2006 at 2:44 am
Hey there – Nice posting!
I am curious.. I found this post through http://www.chrisjdavis.org/2006/05/06/custom-excerpts-for-wordpress/
Question: Were you able to get Chris’s method to work for you as well?
May 23rd, 2006 at 11:36 am
Hi Jeremy.
To be honnest I did not even try to implement Chris’s method. I found his post after having done my changes.
Did you have a crack it?