WordPress.org

Ready to get started?Download WordPress

Forums

Display Posts Shortcode
[resolved] excerpt vs full text of post (8 posts)

  1. jmichaelk
    Member
    Posted 2 years ago #

    I am including a page on my (non-blog) website that uses Display Posts Shortcode to aggregate posts into a feed-like format. The standard post is serving as a tool to display snippets or very short news stories about the organization for which I'm building the site. There is no commenting going on, just title + content. I am hoping to be able to include the title and full post in my feed-like format, but I only see an argument for the excerpt. Currently, I have just lengthened the word count max for the excerpt to be much longer than typical so essentially the full post is shown in my 'feed' - the workaround is sufficient, but just wanted to see if there is an easy way to include the full text so I'm not perpetually limited to whatever word count max I set (or conversely, needing to bump up the word count for every post that happens to go over the limit). Thank you.

    http://wordpress.org/extend/plugins/display-posts-shortcode/

  2. Bill Erickson
    Member
    Plugin Author

    Posted 2 years ago #

    Yes, you can, but this will require writing an output filter in your theme's functions.php file. Here's the code you paste in that file: https://gist.github.com/1298344

    Note that this turns the excerpt into the full content, so you'll need to have the shortcode set to display the excerpt.

  3. jmichaelk
    Member
    Posted 2 years ago #

    Thanks for the response. I am new at all of this, so I'm unclear on the response comment added (by GaryJones) to the github code you reference in this case.

    Also, when I tried pasting the code as is, into my functions.php, I get the following error. Are you able to direct me on what this means? Are his comment and my error related?

    Parse error: syntax error, unexpected '<' in /data/22/2/59/66/2548718/user/2793317/htdocs/WordPress/wp-content/themes/platformbase/functions.php on line 22

  4. Bill Erickson
    Member
    Plugin Author

    Posted 2 years ago #

    Gary was just being nitpicky about the comment block at the top. It doesn't affect the code at all.

    I'd have to see your code to confirm, but my guess is that you do not need the <?php at the top of the code snippet.

  5. BillGates_XP
    Member
    Posted 2 years ago #

    Hi, that 2 days have passed I can not understand how to make the parent post here they are examples of fasting,
    1-position itself http://www.hipstrumentals.com/2011/11/kid-ink-like-ag-instrumental-hook/
    2-parent's post http://www.hipstrumentals.com/2011/11/kid-ink-like-a-g-instrumental-hook/kid-ink-ft-travis-porter-like-a-g-instrumental/
    friends please help, it seemed logical as you think?
    parent post does not even have headings, and do not see how this is? 2 See second post to see.

  6. emilysparkle
    Member
    Posted 2 years ago #

    so... to be clear, if i add this to my functions file, it changes all excerpts to full text?

    i have a page that i want to display the full text of one post to show and the excerpts of 3 from a certain category.

    if that's possible, how would i edit these shortcodes??

    right now what i have below only shows one excerpt from the blog and the excerpt from the specific post...

    [display-posts image_size="thumbnail" include_excerpt="true" posts_per_page="3" wrapper="div" title_class="display-posts-title" date="yes"]
    
    [display-posts id="964" image_size="thumbnail" include_excerpt="false" posts_per_page="1" wrapper="div" title_class="display-posts-title" date="no"]
  7. Leiif
    Member
    Posted 2 years ago #

    I am trying to get the page to display a category 10 posts at a time but would like the output to be the same as my default posts page. The default posts page shows the excerpt up to the <!--more--> tag in the html code then has the read more link. It also includes the first image. And it has an older posts link at the bottom for the posts beyond the count of 10. So far all I am getting is the title and the short excerpt. I figured out that the thumbnail is only generated by having an image set as featured. I may be able to use this if I set the post count to all and make sure I have an image for each. Currently using the category page itself in a custom menu to show as a page. Any help appreciated.

  8. Leiif
    Member
    Posted 2 years ago #

    My question has been resolved. I found a work around with the Advanced Excerpts plugin.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic