WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Setting limit number for MiniPosts plugin (14 posts)

  1. Daisyhead
    Member
    Posted 7 years ago #

    I am trying to set the limit for the number of posts the MiniPosts plugin should show. I have tried editing the code per Doocy's instructions but no matter what I put, it's not working. Would anyone be able to give me a pointer or two? I want to limit my posts to 2 or 3.

    Thanks!

  2. Daisyhead
    Member
    Posted 7 years ago #

    I should mention that I want to keep all the defaults and just be able to limit the number of posts displayed.

    I tried again to figure this out myself but no luck.

    Grr! I love and appreciate all the time and effort plugin developers put into helping me make my blog a prettier/niftier place but sometimes I wish they would document a tad bit better for those of us who don't quite speak the lingo.

  3. Daisyhead
    Member
    Posted 7 years ago #

    Bueller?

  4. Daisyhead
    Member
    Posted 7 years ago #

    Anyone?

  5. Daisyhead
    Member
    Posted 7 years ago #

    Okay, I've posted on the plugin developer's site and still haven't gotten any help on this. Can anyone help me figure out how to limite the number of posts that this plugin displays?

    I'll give you a nice shiny quarter! ;-)

  6. Daisyhead
    Member
    Posted 7 years ago #

    Okay, the developer has now turned comments off for this plugin on his blog. My question went into moderation and didn't even get to be displayed on his blog.

    Can anyone take a look at this plugin and tell me what code I need to put to only display 2 posts? I should mention that I want to keep all the defaults for this plugin and just be able to limit the number of posts displayed.

  7. logista
    Member
    Posted 7 years ago #

    In your index.php (or wherever you call the miniposts plugin), there should be a line that says get_mini_posts() which will call the basic function using the defaults

    Earlier in the page, he says get_mini_posts(format, permalink_text, zero_comments, one_comment, more_comments, limit) is the structure for the function, so to use the defaults mostly, but change the limit, you'd pretend to fill in the defaults -- but with nothing there.

    So, try get_mini_posts(,,,,, 2) (it works best to copy the whole function, and delete the bits you don't want).

    Hope this helps!

  8. Daisyhead
    Member
    Posted 7 years ago #

    When I try modifying the code like that, all it does is put the options as text.

    Here's what I have: <?php get_mini_posts(",,,,, 3"); ?>

    But all I see after the actual content is /////3.

    This is the strangest plugin I've worked with so far. None of the usual modfications seem to work with it. Any other ideas?

  9. Chris_K
    Member
    Posted 7 years ago #

    what happens if you lose the double-quotes?

  10. Daisyhead
    Member
    Posted 7 years ago #

    It throws an error.

  11. Daisyhead
    Member
    Posted 7 years ago #

    Actually, if I use a single tick, I just get the same thing. If I take them out all together, I get a parse error.

  12. logista
    Member
    Posted 7 years ago #

    In the plugin, there's a function function get_mini_posts($format = '%post% %commentcount% %permalink%', $permalink_text = '', $zero_comments = '', $one_comment = '', $more_comments = '', $limit = '')
    what happens if you set $limit = '' to something like $limit = '2'?

    (Just guessing, here, obviously)

  13. Daisyhead
    Member
    Posted 7 years ago #

    That did it! I swear I tried that before and it didn't work. Thank you so much Logista!

  14. logista
    Member
    Posted 7 years ago #

    *phew* I'm glad it worked out -- that's at my limit of plug-in programming knowledge ;)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.