Title: Bug in related-posts.php causing count() warning
Last modified: February 6, 2022

---

# Bug in related-posts.php causing count() warning

 *  Resolved [bobthedino](https://wordpress.org/support/users/bobthedino/)
 * (@bobthedino)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/bug-in-related-posts-php-causing-count-warning/)
 * For info: line 167 of related-posts.php was causing a warning:
    count(): Parameter
   must be an array or an object that implements Countable
 * The fix was to change line 167 from:
 * if ( count( $these_tags ) > 0 && count( $these_tags >= 2 ) ) {
 * to:
 * if ( count( $these_tags ) > 0 && count( $these_tags ) >= 2 ) {

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [airdrummer](https://wordpress.org/support/users/airdrummer/)
 * (@airdrummer)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/bug-in-related-posts-php-causing-count-warning/#post-15334196)
 * sorry, there is no line 167 in either
    wptouch/themes/foundation/default/related-
   posts.php or wptouch/themes/bauhaus/default/related-posts.php
 *  Thread Starter [bobthedino](https://wordpress.org/support/users/bobthedino/)
 * (@bobthedino)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/bug-in-related-posts-php-causing-count-warning/#post-15336300)
 * Hi, hmmm OK, well the file I’m referring to is in:
 * wp-content/wptouch-data/extensions/related-posts/related-posts.php

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Bug in related-posts.php causing count() warning’ is closed to new replies.

 * ![](https://ps.w.org/wptouch/assets/icon-256x256.png?rev=1313960)
 * [WPtouch - Make your WordPress Website Mobile-Friendly](https://wordpress.org/plugins/wptouch/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wptouch/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wptouch/)
 * [Active Topics](https://wordpress.org/support/plugin/wptouch/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wptouch/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wptouch/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [bobthedino](https://wordpress.org/support/users/bobthedino/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/bug-in-related-posts-php-causing-count-warning/#post-15336300)
 * Status: resolved