Search code examples
magentofishpig

How do I modify blog post excerpt from Fishpig?


I'm using Fishpig to pull in blog posts from WordPress and everything is working fine. However, on /blog instead of having the blog posts displayed in their full length I'd like to use excerpts from the posts (similar to WordPress's method of showing posts in archive/category/ect).

I found default.phtml under app/design/frontend/base/default/template/wordpress/post/list/renderer/default.phtml and see that on line 21 is <?php echo $post->getPostExcerpt() ?>

When commenting this out the content from the posts on /blog no longer shows, indicating I'm in the right file. I really wish I could just use get_excerpt(); here. How/what do I modify to pull in an excerpt instead so the blog pages listing posts don't just pull in the entirety of each post?


Solution

  • To show an excerpt, you have 3 different options:

    1) Go to your post in the WordPress Admin and manually enter a post excerpt in the post excerpt field. This field is located just below the post content field. If this isn't visible, click the 'Screen Options' tab at the top of the page and enable the post excerpt field.

    2) Go to your post in the WordPress Admin and use the More tag/button to split the post. Every thing before the More tag will be used as the post excerpt. You can find out more about the More tag at the following URL:

    http://en.support.wordpress.com/splitting-content/more-tag/

    3) Open the list template (wordpress/post/list/renderer/default.phtml) and add some PHP code to shorten the post content.