WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Displaying posts from the same category - cant set how many (3 posts)

  1. devotee
    Member
    Posted 3 years ago #

    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

  2. vtxyzzy
    Member
    Posted 3 years ago #

    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 );

  3. devotee
    Member
    Posted 3 years ago #

    Thank you! That did the trick ;)

Topic Closed

This topic has been closed to new replies.

About this Topic