Title: [Plugin: Easy Popular Posts] show=false does not work
Last modified: August 19, 2016

---

# [Plugin: Easy Popular Posts] show=false does not work

 *  [Bart McLeod](https://wordpress.org/support/users/mcleodspacewebnl/)
 * (@mcleodspacewebnl)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-easy-popular-posts-showfalse-does-not-work/)
 *     ```
       <?php
       	if (function_exists('popularPosts')) {
       		$populars = popularPosts('show=false');
       		if (is_array($populars)) {
       			foreach ($populars as $popular) {
       				var_dump($popular);
       			}
       		}
       	}
       ?>
       ```
   
 * I tried the above, following your FAQ from the plugin repository. But show=false
   does not return the links, it just spits them out as if false was not in the 
   parameters. Am I doing something wrong? I will look into the code later.
 * [http://wordpress.org/extend/plugins/easy-popular-posts/](http://wordpress.org/extend/plugins/easy-popular-posts/)

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

 *  Thread Starter [Bart McLeod](https://wordpress.org/support/users/mcleodspacewebnl/)
 * (@mcleodspacewebnl)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-easy-popular-posts-showfalse-does-not-work/#post-1947791)
 * Well, I looked into the code and found why it does not work.
 *     ```
       if ( $ns_options['show'] ) {
       		echo $popular;
       	} else {
       		return $popular;
       	}
       ```
   
 * The above bit of code should obviously be:
 *     ```
       if ( $ns_options['show'] !== 'false') {
       		echo $popular;
       	} else {
       		return $popular;
       	}
       ```
   
 * Since all the options are extracted as strings, string ‘false’ converts to boolean
   true if you just check if it is set. Instead, you should do a check for the exact
   string ‘false’.
 * And then, after changing the code in this way, my snippet will still not work,
   because the result is not an array. This is not wrong by the way.
 * Why would I like to change the behavior? [maybe it already exists, I have to 
   dig in further]. Well, I would like the first of the popular posts to show the
   excerpt and the title only for the rest of them.
 *  Thread Starter [Bart McLeod](https://wordpress.org/support/users/mcleodspacewebnl/)
 * (@mcleodspacewebnl)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-easy-popular-posts-showfalse-does-not-work/#post-1947793)
 * The same applies to:
 *     ```
       if ( $ns_options['credit'] !== 'false' ) {
       		$popular .= "<li style='opacity:0.4;filter:alpha(opacity=40);'><a href='http://thisismyurl.com/downloads/wordpress/plugins/easy-popular-posts/?source=" . urlencode(get_bloginfo('url')) . "' style='opacity:0.4;filter:alpha(opacity=40);' target='_blank'>Easy Popular Posts by Christopher Ross</a></li>";
       	}
       ```
   
 *  Thread Starter [Bart McLeod](https://wordpress.org/support/users/mcleodspacewebnl/)
 * (@mcleodspacewebnl)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-easy-popular-posts-showfalse-does-not-work/#post-1947796)
 * I have refactored your plugin code to allow for separate retrieval of the popular
   posts as an array and fixed the two bugs mentioned above.
 * Do you have an repository or e-mail where I can post the altered plugin so that
   you can use it if you like?
 *  [christopherross](https://wordpress.org/support/users/christopherross/)
 * (@christopherross)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-easy-popular-posts-showfalse-does-not-work/#post-1947814)
 * Hi Bart, thanks for addressing that. I try my best to keep the plugins updated
   and tested, it’s surprising to me that this was not working as I’ve used it myself
   for many years without issue.
 * If you could send the plugin to me (info@thisismyurl.com) I’ll review it and 
   update the version here on WordPress.org as soon as possible.
 * Chris

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

The topic ‘[Plugin: Easy Popular Posts] show=false does not work’ is closed to new
replies.

 * ![](https://ps.w.org/easy-popular-posts/assets/icon-128x128.png?rev=1053584)
 * [Easy Popular Posts](https://wordpress.org/plugins/easy-popular-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/easy-popular-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/easy-popular-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/easy-popular-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/easy-popular-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/easy-popular-posts/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [christopherross](https://wordpress.org/support/users/christopherross/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-easy-popular-posts-showfalse-does-not-work/#post-1947814)
 * Status: not resolved