Support » Plugin: Display Posts - Easy lists, grids, navigation, and more » How to display a only one latest post?

  • Resolved prash009

    (@prash009)


    My requirement is to display only one latest post with shortcodes or How to limit the post with shortcodes.

    I want only one latest post should be displayed.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Bill Erickson

    (@billerickson)

    You can use the posts_per_page parameter like this:

    [display-posts posts_per_page="1"]

    Is there a way to really strip down the features of this plugin to not only do what’s described above, but also to prevent any styles from being applied? Basically, this would be used to link a post inline with regular text. For example, if the desired effect is text that looks like this, AND still have the blog post title be linked to the post…

    Read my latest blog post, My Amazing Blog Post, which is even better than the previous post.

    …what shortcode parameters could be used? I have tried setting the two styles available for change through the shortcode params to “”, and the wrapper class to “div”, yet there are still other styles being injected as I can see through source code analysis.

    Plugin Author Bill Erickson

    (@billerickson)

    Display Posts does not include any styling (CSS). All styling comes from your theme.

    However, all the “wrapper” options are block-level elements (unordered list, ordered list, or div).

    Even if you attempt to style them like an inline element (ex: .display-posts-listing { display: inline; } ), WordPress will add paragraphs above and below the listing because it knows it should be a block level element.

    You’ll need to modify the output of the shortcode to display an inline element. Here’s a tutorial: https://displayposts.com/2019/01/23/display-inline-link-with-most-recent-post/

    Thanks. I did it, and it works. I hope you consider integrating this into the plugin proper in the future so others can more easily use it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to display a only one latest post?’ is closed to new replies.