Title: Variable &gt; or &lt; 0
Last modified: January 2, 2018

---

# Variable > or < 0

 *  Resolved [Fred](https://wordpress.org/support/users/bitcoinlister/)
 * (@bitcoinlister)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/variable-or-0/)
 * Hello,
    I want to print ‘positive’ or ‘negative’ if {variation} placeholder is
   > or <0.
 * In a WordPress post with PHP Exec enabled, I tried the following code:
 * `[jsoncontentimporter url=”[https://www……&#8221](https://www……&#8221); numberofdisplayeditems
   =”300″ ]
 * <?php
    $var='{variation}’; echo $var; // OK – it gets correctly printed.
 * if ($var<0) {
    echo ‘negative’; } else { echo ‘positive’; // BAD – It always 
   prints ‘positive’ even if variation equals -35. }
 *  [/jsoncontentimporter]’

Viewing 1 replies (of 1 total)

 *  Plugin Author [berkux](https://wordpress.org/support/users/berkux/)
 * (@berkux)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/variable-or-0/#post-9835989)
 * Hello,
 * ok, but what’s the problem? I guess this does not work.
    You might use [https://de.wordpress.org/plugins/insert-php/](https://de.wordpress.org/plugins/insert-php/)
   but then the question is, what Plugin (JSON… or InsertPHP) is executed first.
   << It always prints ‘positive’ even if variation equals -35.>> I guess, first
   the PHP is executed with result “positive” and after that the plugin is done.
 * The pro-version comes with twig which can do if-then-else
    [https://twig.symfony.com/doc/1.x/tags/if.html](https://twig.symfony.com/doc/1.x/tags/if.html)
 * Bernhard

Viewing 1 replies (of 1 total)

The topic ‘Variable > or < 0’ is closed to new replies.

 * ![](https://ps.w.org/json-content-importer/assets/icon-256x256.png?rev=3464653)
 * [Get Use APIs - JSON Content Importer](https://wordpress.org/plugins/json-content-importer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/json-content-importer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/json-content-importer/)
 * [Active Topics](https://wordpress.org/support/plugin/json-content-importer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/json-content-importer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/json-content-importer/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [berkux](https://wordpress.org/support/users/berkux/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/variable-or-0/#post-9835989)
 * Status: resolved