Title: rtoads's Replies | WordPress.org

---

# rtoads

  [  ](https://wordpress.org/support/users/rtoads/)

 *   [Profile](https://wordpress.org/support/users/rtoads/)
 *   [Topics Started](https://wordpress.org/support/users/rtoads/topics/)
 *   [Replies Created](https://wordpress.org/support/users/rtoads/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/rtoads/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/rtoads/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/rtoads/engagements/)
 *   [Favorites](https://wordpress.org/support/users/rtoads/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Foyer - Digital Signage for WordPress] Refresh time](https://wordpress.org/support/topic/refresh-time-2/)
 *  [rtoads](https://wordpress.org/support/users/rtoads/)
 * (@rtoads)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/refresh-time-2/#post-12041200)
 * OK, I’ll answer my own questions: Yes, Foyer reloads the post every 5 minutes
   and instead of wp-cron, it’s javascript doing the reloading every 5 minutes. 
   Thanks for writing this plugin. It’s very handy.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Foyer - Digital Signage for WordPress] Refresh time](https://wordpress.org/support/topic/refresh-time-2/)
 *  [rtoads](https://wordpress.org/support/users/rtoads/)
 * (@rtoads)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/refresh-time-2/#post-12040136)
 * Also, I didn’t see any wp-cron jobs set up by Foyer when I installed it. How 
   does the scheduled check for changes work?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Foyer - Digital Signage for WordPress] Refresh time](https://wordpress.org/support/topic/refresh-time-2/)
 *  [rtoads](https://wordpress.org/support/users/rtoads/)
 * (@rtoads)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/refresh-time-2/#post-12040117)
 * I have a related question about the refresh. The FAQ says “Each digital sign 
   tries to contact your website every 5 minutes to see if you made any changes.
 * My question is: what constitutes a change? For example I have a Post slide with
   a shortcode that presents content that can change every five minutes. The Post
   itself doesn’t change, but the content displayed does. Will Foyer notice the 
   changed content? If not, how can I get it to reload the Post itself every 5 minutes?
 * Thanks.
 * (BTW, searching in this forum for “refresh” didn’t turn up this thread! Something
   seems to be wrong with the WordPress.org search engine.)
    -  This reply was modified 6 years, 7 months ago by [rtoads](https://wordpress.org/support/users/rtoads/).
    -  This reply was modified 6 years, 7 months ago by [rtoads](https://wordpress.org/support/users/rtoads/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Simple Calendar - Google Calendar Plugin] Suddenly, no events appearing, can't view API key in dev console](https://wordpress.org/support/topic/suddenly-no-events-appearing-cant-view-api-key-in-dev-console/)
 *  Thread Starter [rtoads](https://wordpress.org/support/users/rtoads/)
 * (@rtoads)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/suddenly-no-events-appearing-cant-view-api-key-in-dev-console/#post-6422433)
 * Argh, I figured it out. I didn’t realize the “Number of Days” is an option that
   I should have had set to “Number of Events”. I thought they were the same thing.
   So the events that didn’t appear were showing up outside the 12-day range.
 * I really did have a problem with my Google API key as well, as test events within
   the 12 days were not showing until I updated it, but the follow-up problem was
   just user error. Sorry!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Simple Calendar - Google Calendar Plugin] Suddenly, no events appearing, can't view API key in dev console](https://wordpress.org/support/topic/suddenly-no-events-appearing-cant-view-api-key-in-dev-console/)
 *  Thread Starter [rtoads](https://wordpress.org/support/users/rtoads/)
 * (@rtoads)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/suddenly-no-events-appearing-cant-view-api-key-in-dev-console/#post-6422333)
 * Calendar is definitely public. Google did start giving me events after a while,
   but what I have since observed is that an event on Aug 12 is displaying, but 
   an event on Aug 26 is not. Also, if I moved the Aug 12 event to Aug 26, it falls
   off the list and nothing displays.
 * Num days is set to 12 but only 1 Aug 12 event shows. Perhaps this was the real
   symptom all along.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Simple Calendar - Google Calendar Plugin] Suddenly, no events appearing, can't view API key in dev console](https://wordpress.org/support/topic/suddenly-no-events-appearing-cant-view-api-key-in-dev-console/)
 *  Thread Starter [rtoads](https://wordpress.org/support/users/rtoads/)
 * (@rtoads)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/suddenly-no-events-appearing-cant-view-api-key-in-dev-console/#post-6422264)
 * Update: Google Developers Console had somehow been disabled in our Google Apps
   for Business deployment and the project/key appeared to have vanished.
 * I enabled the Console, created a new API key, pasted it into the GCal settings,
   cleared cache, but still am not seeing the newly-created events. How to troubleshoot?
   Thanks.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Widget Logic] True condition that fails](https://wordpress.org/support/topic/true-condition-that-fails/)
 *  Thread Starter [rtoads](https://wordpress.org/support/users/rtoads/)
 * (@rtoads)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/true-condition-that-fails/#post-3539012)
 * This code appears to work properly!
 *     ```
       global $post;$term_list = wp_get_post_terms($post->ID, 'Placement', array("fields" => "all"));$primary_placement = $term_list[0]->slug;if($primary_placement == "home") $primary_placement = $term_list[1]->slug;
       return (!is_category('writing') and !is_category('resource-center') and !is_home() and $primary_placement == 'writing-home');
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Widget Logic] True condition that fails](https://wordpress.org/support/topic/true-condition-that-fails/)
 *  Thread Starter [rtoads](https://wordpress.org/support/users/rtoads/)
 * (@rtoads)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/true-condition-that-fails/#post-3539009)
 * Thanks. Sorry to be dense, but would the syntax of a compound test then be as
   I wrote it above? That is:
 * `return ($primary_placement == 'writing-home' && in_category('writing'));`
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Widget Logic] True condition that fails](https://wordpress.org/support/topic/true-condition-that-fails/)
 *  Thread Starter [rtoads](https://wordpress.org/support/users/rtoads/)
 * (@rtoads)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/true-condition-that-fails/#post-3539006)
 * OK, I guess I don’t understand what the semicolon rules are in Widget Logic tests.
   If I only use WP conditional built-ins, I don’t need a semicolon? But if I use
   a PHP variable I do?
 * How would I mix testing with built-ins like in_category(‘writing’) and the returned
   variable? Like this?
 *     ```
       global $post;$term_list = wp_get_post_terms($post->ID, 'Placement', array("fields" => "all"));$primary_placement = $term_list[0]->slug;if($primary_placement == "home"){$primary_placement = $term_list[1]->slug;}
       return ($primary_placement == 'writing-home' && in_category('writing'));
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Widget Logic] True condition that fails](https://wordpress.org/support/topic/true-condition-that-fails/)
 *  Thread Starter [rtoads](https://wordpress.org/support/users/rtoads/)
 * (@rtoads)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/true-condition-that-fails/#post-3539004)
 * This really seems to be a parsing error. The PHP code works when I execute it
   elsewhere. I just want to be sure I’m following Widget Logic’s rules for crafting
   the code. Am I? Thanks.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Widget Logic] True condition that fails](https://wordpress.org/support/topic/true-condition-that-fails/)
 *  Thread Starter [rtoads](https://wordpress.org/support/users/rtoads/)
 * (@rtoads)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/true-condition-that-fails/#post-3539001)
 * This code:
 *     ```
       global $post;$term_list = wp_get_post_terms($post->ID, 'Placement', array("fields" => "all"));$primary_placement = $term_list[0]->slug;if($primary_placement == "home"){$primary_placement = $term_list[1]->slug;}
       return ($primary_placement == 'writing-home')
       ```
   
 * produces this PHP error:
 * PHP Parse error: syntax error, unexpected $end in /mnt/stor10-wc1-ord1/803637/
   www.pyragraph.com/web/content/wp-content/plugins/widget-logic/widget_logic.php(
   284) : eval()’d code on line 2
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Widget Logic] True condition that fails](https://wordpress.org/support/topic/true-condition-that-fails/)
 *  Thread Starter [rtoads](https://wordpress.org/support/users/rtoads/)
 * (@rtoads)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/true-condition-that-fails/#post-3538999)
 * I took a look at the PHP error log, and here’s what I get when I run Version 
   1 above:
 * PHP Parse error: syntax error, unexpected T_GLOBAL in /wp-content/plugins/widget-
   logic/widget_logic.php(284) : eval()’d code on line 1
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Widget Logic] True condition that fails](https://wordpress.org/support/topic/true-condition-that-fails/)
 *  Thread Starter [rtoads](https://wordpress.org/support/users/rtoads/)
 * (@rtoads)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/true-condition-that-fails/#post-3538998)
 * Hi. Back again with another true condition that fails. It may be failing because
   I’ve somehow got the syntax wrong, but the condition of the post’s slug (either
   slug 0 or slug 1) being ‘writing-home’ is definitely true on the two different
   posts I tested. I wrote the logic two ways and both fail:
 * Version 1:
 *     ```
       global $post;$term_list = wp_get_post_terms($post->ID, 'Placement', array("fields" => "all"));$primary_placement = $term_list[0]->slug;if($primary_placement == "home"){$primary_placement = $term_list[1]->slug;}
       $primary_placement == 'writing-home'
       ```
   
 * Version 2:
 *     ```
       global $post;$term_list = wp_get_post_terms($post->ID, 'Placement', array("fields" => "all"));$primary_placement0 = $term_list[0]->slug;$primary_placement1 = $term_list[1]->slug;
       $primary_placement0 == 'writing-home' || ($primary_placement0 == 'home' && $primary_placement1 == 'writing-home')
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Widget Logic] True condition that fails](https://wordpress.org/support/topic/true-condition-that-fails/)
 *  Thread Starter [rtoads](https://wordpress.org/support/users/rtoads/)
 * (@rtoads)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/true-condition-that-fails/#post-3538831)
 * Aha. I see now I need to global in $post. Thank you. But since $terms is defined
   inline, isn’t it available to the logic? If not, where would I put the global
   statement?

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