WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Displaying posts from the same category – cant set how many

[Resolved] Displaying posts from the same category – cant set how many

  • devotee
    Member

    @devotee

    I´m using this nifty code to display thumbnails from posts belonging to the same category as the currently viewed post.

    http://pastebin.com/Sj2CfJDF

    That it does well, but it won´t allow me to set the amount of thumbnails. Changing the value for $thumbnail_max = x; does nothing. Can anybody see what could be wrong?

    Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • vtxyzzy
    Member

    @vtxyzzy

    There is a misplaced quote mark in the code. Try changing this:

    $category_thumb_args = array( 'category__in' => $category_id_array, 'posts_per_page => $thumbnail_max', 'exclude' => $post->ID );

    to this:

    $category_thumb_args = array( 'category__in' => $category_id_array, 'posts_per_page' => $thumbnail_max, 'exclude' => $post->ID );

    devotee
    Member

    @devotee

    Thank you! That did the trick 😉

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Displaying posts from the same category – cant set how many’ is closed to new replies.