Support » Plugin: TPG Get Posts » Want to show only one post on page

  • Resolved Nicknz



    I really think this is the plugin I need, looks really good but I don’t get it working the way I want. I am getting the code right. on my website On the homepage I want to have just one (latest) post without category title. 6 or 7 lines of text max and then the read more option. I am using this code
    [tpg_get_posts fields=”title,byline,content,metadata”
    fields_classes =”post_title=tpg-title-class, post_content=tpg-content-class,post_byline=tpg-byline-class,post_metadata=tpg-metadata-class” numberposts=2 ]

    But still getting 5 post showing anybody can help me with the correct code for my homepage?

    thank you!

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


    I would suggest starting simple.

    [tpg_get_posts numberposts=1 ]

    That should pull 1 post, then you can eliminate category (category info is part of the metadata.

    [tpg_get_posts fields="title,byline,content" numberposts=1 ]

    Also remember if you are using cache, you will need to refresh the cache to force the changes to show immediately


    Thank you for the fast reply. I am now using [tpg_get_posts cat=”nieuw-zeeland-informatie” numberposts=1] and paste it as html and it is working but I like to have the only about 5 or 6 text line and then the read more tag. also maybe by doing that have two post with 5 or 6 text line each.

    and then from all cat. not only nieuw-zeeland-informatie so that is “all”?

    hope you can help me with this specially the 5 or 6 line txt with the read more tag

    [tpg_get_posts cat=”all” numberposts=2] ?

    thank you for helping me out

    sorry this is all new to me so not sure how to use the code. thank you

    Plugin Author cswaim


    To insert the read more break, this is done in the post editor.

    Edit the post in Visual Mode. In the top row of icons, just to the right of middle (on my setup) is an ‘Insert More Tag’ icon. Move your cursor to the point in the post you want a break, click the ‘insert more tag’ icon.

    This puts a WP tag <!--more--> in the post. When the post is rendered in the blog list (or my plugin) it will stop at the <more> tag and insert the read-more text.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Want to show only one post on page’ is closed to new replies.