Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)
  • 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.

    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?

    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.
    • This reply was modified 6 years, 7 months ago by rtoads.
    Thread Starter rtoads

    (@rtoads)

    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!

    Thread Starter rtoads

    (@rtoads)

    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.

    Thread Starter rtoads

    (@rtoads)

    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.

    Thread Starter rtoads

    (@rtoads)

    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');
    Thread Starter rtoads

    (@rtoads)

    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'));

    Thread Starter rtoads

    (@rtoads)

    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'));
    Thread Starter rtoads

    (@rtoads)

    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.

    Thread Starter rtoads

    (@rtoads)

    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

    Thread Starter rtoads

    (@rtoads)

    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

    Thread Starter rtoads

    (@rtoads)

    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')

    Thread Starter rtoads

    (@rtoads)

    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)