Support » Fixing WordPress » Displaying posts from the same category – cant set how many

  • Resolved devotee

    (@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)
  • 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 );

    Thank you! That did the trick 😉

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