Forum

 
You must be logged in to post Login Register


Register? | Lost Your Password?

Search Forums:


 






Wildcard Usage:
*    matches any number of characters
%    matches exactly one character

tiny bit of help needed

Topic Locked
UserPost

7:58 am
September 8, 2009


neologan

Member

posts 17

1

First, i think this is my favourite plugin!

I'm currently doing some customisations to it, and have added post excerpts to display, along with date published, and so on.

My issue is with excerpts, i'm currently doing this:

' .  $findpost->post_excerpt . '

in // all other posts except the current post, only this bypasses the features of the_excerpt, specifically not allowing the word length to be specified. I also like the other features of the_excerpt.

So my question, how can i show a post excerpt properly so i get all the features of the_excerpt?

8:55 pm
September 8, 2009


Ade

Admin

posts 1140

2

Glad you're enjoying it. Smile

the_excerpt doesn't take any parameters and therefore you can't specify the number of words to display. It either shows the first 55 words or the words you manually enter in the excerpt box in the Post Editor.

the_excerpt()

Dynamic Content Gallery: Have you read the Configuration Guide and FAQ?

8:58 pm
September 8, 2009


neologan

Member

posts 17

3

but how do i use the_excerpt instead of the one i was using, post_excerpt?

9:54 pm
September 8, 2009


Ade

Admin

posts 1140

4

They are the same thing.

the_excerpt is the normal template tag used in the Loop, whereas post_excerpt is a parameter of the $post object. Both return exactly the same content, they are just used in different coding contexts.

Dynamic Content Gallery: Have you read the Configuration Guide and FAQ?

10:37 pm
September 8, 2009


neologan

Member

posts 17

5

hmmm, am i missing something here? as stated in the the_excerpt() codex page:

"Displays the excerpt of the current post with [...] at the end, which is not a "read more" link. If you do not provide an explicit excerpt to a post (in the post editor's optional excerpt field), it will display a teaser which refers to the first 55 words of the post's content."

So at the very least if i use $post_excerpt as i have done, i should have "…" at the end of the excerpt, which i do not. And in posts that do not have an excerpt, it should display that first 55 chars of the content, but nothing is displayed.

You can see it at my page: http://www.pcgage.net/2009/09/…..ember-8th/

Am i missunderstanding something here?

Thanks for help,

James.

11:05 pm
September 8, 2009


Ade

Admin

posts 1140

6

Er… I don't provide free WP support Confused

Ok, you've misunderstood and I've slightly misled you. post_excerpt is a direct extraction from the db, therefore if the Excerpt hasn't been created manually, it will be empty. On the other hand, the_excerpt() function extracts the post_excerpt from the db and, if it is empty, automatically creates the excerpt from the first 55 words of your post. As I mentioned before, they are designed to be used in different coding contexts.

As for the [...], this is added by the_excerpt() and does not exist in the db, hence post_excerpt doesn't have it.

Hope that clarifies.

Dynamic Content Gallery: Have you read the Configuration Guide and FAQ?

3:28 am
September 9, 2009


neologan

Member

posts 17

7

understood. The question still arises, and it was a simple one, can, in your plugin code, i use the_excerpt somehow instead of post_excerpt like in the example i initially gave, which was:

' .  $findpost->post_excerpt . '

I didn't feel this was abusing your help, i thought it was a really simple question that just seems to be getting sidetracked.

Thanks.

8:03 am
September 9, 2009


Ade

Admin

posts 1140

8

Try it and see. You won't get the [...] link and you will need to have manually created the exceprt in your posts, as per the previous discussion on this.

Dynamic Content Gallery: Have you read the Configuration Guide and FAQ?