WordPress.org

Ready to get started?Download WordPress

Forums

WP Tiles
[resolved] Only first 5 posts show... (7 posts)

  1. hiphopruckus
    Member
    Posted 1 year ago #

    I have placed the code on the category pages successfully but i can't figure out how to show more than the first 5 posts from each category page.
    How do i get more than 5 posts to show on each page?

    http://wordpress.org/extend/plugins/wp-tiles/

  2. joakimc
    Member
    Posted 1 year ago #

    I'm also only getting 5 posts when showing a category.
    example
    http://nanoworkout.com/category/couch/

    Awesome plugin, thanks!

  3. joakimc
    Member
    Posted 1 year ago #

    I found a solution.
    In post.php (locate din wp-include) change number_posts to a higher number than => 5

  4. Mike
    Member
    Plugin Author

    Posted 1 year ago #

    Hi guys, for what it's worth, I won't up this number in the current version of the plugin, to make sure an update won't break the pages of people who have 5 posts per page on purpose. This'll become an option at some point.

    For now, in your category.php file, update the code to:

    the_wp_tiles('numberposts=20');

    Replacing 20 by the desired number, of course.

    Cheers!
    Mike

  5. maciejkurowski
    Member
    Posted 1 year ago #

    Hi Mike

    I'm not fully sure if I'm correct, but if you specify any attribites for categories like

    the_wp_tiles('numberposts=20');

    wp-tiles shows last posts, not category posts, because of empty($atts) check:

    // If category archive, show
            if ( empty ( $atts ) && ( is_category() || is_single() ) ) {
                $categories = get_the_category();
  6. maciejkurowski
    Member
    Posted 1 year ago #

    ok o got to the solution

    first there is a defect in shortcode_atts_rec (attributes reversed):
    $att = $this->shortcode_atts_rec ( $options[$k],$att );

    then i think the line in wp_tiles should be:
    if ( is_category() || is_single() ) {

    finally $atts are expected to be an array so in category.php:
    the_wp_tiles(array('template'=>'Plain', 'posts_query'=>array('numberposts'=>4))

    array of attributes, of which one is post_query which is array itself with query params

  7. maciejkurowski
    Member
    Posted 1 year ago #

    last thing
    in the_wp_tiles:

    $atts['posts_query']['category'] = implode ( ', ', $cats );
    instead of 'cat'

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.