Title: count function error
Last modified: April 12, 2024

---

# count function error

 *  [ershadzolfi](https://wordpress.org/support/users/ershadzolfi/)
 * (@ershadzolfi)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/count-function-error/)
 * hi,
 * **Fatal error**: Uncaught Error: count(): Argument #1 ($value) must be of type
   Countable|array, string given in line 150 of wp-content/plugins/anspress-question-
   answer/addons/tags/tags.php!
 * the line 150 is:
 * `$ap_max_num_pages = ceil( count( $tags_rows_found ) / $per_page );`
 * So I changed it to:
 *     ```
       <span class="hljs-variable" style="color: var(--cib-color-syntax-blue); font-variation-settings: var(--cib-type-subtitle1-font-variation-settings);">$ap_max_num_pages</span> = <span class="hljs-title function_ invoke__" style="color: var(--cib-color-syntax-purple); font-variation-settings: var(--cib-type-subtitle1-font-variation-settings);">is_countable</span>(<span class="hljs-variable" style="color: var(--cib-color-syntax-blue); font-variation-settings: var(--cib-type-subtitle1-font-variation-settings);">$tags_rows_found</span>) ? <span class="hljs-title function_ invoke__" style="color: var(--cib-color-syntax-purple); font-variation-settings: var(--cib-type-subtitle1-font-variation-settings);">ceil</span>(<span class="hljs-title function_ invoke__" style="color: var(--cib-color-syntax-purple); font-variation-settings: var(--cib-type-subtitle1-font-variation-settings);">count</span>(<span class="hljs-variable" style="color: var(--cib-color-syntax-blue); font-variation-settings: var(--cib-type-subtitle1-font-variation-settings);">$tags_rows_found</span>) / <span class="hljs-variable" style="color: var(--cib-color-syntax-blue); font-variation-settings: var(--cib-type-subtitle1-font-variation-settings);">$per_page</span>) : <span class="hljs-number" style="color: var(--cib-color-syntax-blue); font-variation-settings: var(--cib-type-subtitle1-font-variation-settings);">0</span>; 
       ```
   
 * Update it better please!

Viewing 1 replies (of 1 total)

 *  Plugin Author [Rahul Aryan](https://wordpress.org/support/users/nerdaryan/)
 * (@nerdaryan)
 * [2 years ago](https://wordpress.org/support/topic/count-function-error/#post-17723365)
 * Hello,
 * Is this issue still exists with the newer version of the plugin?

Viewing 1 replies (of 1 total)

The topic ‘count function error’ is closed to new replies.

 * ![](https://ps.w.org/anspress-question-answer/assets/icon-256x256.png?rev=2432843)
 * [AnsPress - Question and answer](https://wordpress.org/plugins/anspress-question-answer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/anspress-question-answer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/anspress-question-answer/)
 * [Active Topics](https://wordpress.org/support/plugin/anspress-question-answer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/anspress-question-answer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/anspress-question-answer/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Rahul Aryan](https://wordpress.org/support/users/nerdaryan/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/count-function-error/#post-17723365)
 * Status: not resolved