WordPress.org

Ready to get started?Download WordPress

Forums

Category Shortcode
Add a next button to results. (4 posts)

  1. Deyson
    Member
    Posted 2 years ago #

    Hello I hope you are having a great day :)

    My question is, if I choose to only show a few excerpts from a category. Is there a way I can add a next button to show the remaining results.

    This is the code I am using: [Category number='9' method='excerpt' order='desc' id='11' orderby='date']

    Right now I am revealing 21 excerpts and I would like to break it down to groups of 9.
    But when I do this, it only shows 9 with no button to view the rest.

    http://wordpress.org/extend/plugins/category-shortcode-w-generator/

  2. joe1977
    Member
    Posted 2 years ago #

    Deyson,

    Any solution for this yet?

    I'm looking to do the same thing. When I list posts from a category using the short code, I'd like it to list like up to 5, then a new page with next 5, and so on for all the posts in the category.

    This is very similar to how the Category Archive page is set-up. Although I have found the php code that makes that page work, I cannot find an equivalent in the category_shortcode.php file. Basically, a variable and corresponding code need to be added to loop that says "max number of posts per page = x and once x is reached, create a new page, with a next or back button.

    If Robert Drake is out there, let us know at least where to look to add that functionality to the code.

  3. Deyson
    Member
    Posted 2 years ago #

    Hello Joe. I have not found a solution for this. Sorry.

    If you find anything let me know please. Have a great day!

  4. robertdrake
    Member
    Plugin Author

    Posted 2 years ago #

    With how the plugin is currently coded, it's not easily possible. The whole print out is a giant foreach loop 'foreach($rdcsc_posts as $post)'. You could add a while loop to that to count up to the $rd_loop_postnum variable but thats a pretty bad hack.

    Really, if you want to have pageination you're better off using a category template and a standard post loop. http://codex.wordpress.org/Category_Templates

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic