WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: ProjectManager] Feature Request: Limit number of results returned (4 posts)

  1. randyhoyt
    Member
    Posted 5 years ago #

    It would be great if the number of results returned by a shortcode could be limited. The WordPress get_posts() function has a parameter that works like this, numberposts. I would imagine the shortcode looking something like this:

    [project id=1 results=4]

    To achieve this right now, I have written a custom template called "table-four-results.php" that only outputs the first four results, but it would be good if this could be abstracted out to the shortcode.

    http://wordpress.org/extend/plugins/projectmanager/

  2. Kolja
    Member
    Posted 5 years ago #

    Should the limit only display 4 datasets and that's all, or include a pagination, so just change the number of objects per page?

  3. randyhoyt
    Member
    Posted 5 years ago #

    Just four datasets and that's all.

  4. Kolja
    Member
    Posted 5 years ago #

    I've implemented the shortcode attributes as you suggested, except that you specifcy formfields only with its ID (second example).

    [project id=ID results=3]
    [project id=ID form_id=12 form_value='Hello']
    [project id=ID orderby=rand results=3]

Topic Closed

This topic has been closed to new replies.

About this Topic