WordPress 事件日历 PHP 不适用于 Godaddy 服务器,但适用于 WAMP localhost

WordPress Events Calendar PHP not working on Godaddy server, but works in WAMP localhost

此代码适用于我的 WAMP 本地主机,但不适用于 Godaddy 服务器,我检查了 php 版本,它们是相同的,一直在努力找出问题所在。有人有建议吗?谢谢

网站:http://www.thearcticplayhouse.com

    <div id="index-row3" class="widthfull clearfix">

        <img src="<?php print IMAGES; ?>/upcoming_events.png" title="Arctic playhouse shows" class="alignleft upcoming"/>

        <div class="wrapper-events width100 alignleft">
                    <?php

                            global $post;

                            // Retrieve the next 5 upcoming events
                            $date = new DateTime();
                            $events = tribe_get_events( array(

                                   'posts_per_page' => 5,
                                   'start_date' => strtotime($date->format('Y-m-d'))
                            ) );

                    foreach ( $events as $post ) { 

                                setup_postdata( $post );
                                $tribeDate = tribe_get_start_date();
                                $displayDate = explode(" ", $tribeDate);

                    ?>
            <article id="event-<?php the_ID(); ?>" <?php post_class(); ?>>

                <div id="event-post"  class="alignleft">

                        <div class="alignleft">

                              <ul class="event-date">

                                  <li class="month"><?php echo substr($displayDate[0], 0, 3); ?></li>
                                  <li class="day"><?php echo $displayDate[1]; ?></li>
                                  <li class="event-time"><?php echo $displayDate[2]; ?> <?php echo $displayDate[3]; ?></li>

                              </ul>                  

                        </div>                      


                        <h2><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>  

                         <div id="event-content">

                            <a href="<?php the_permalink(); ?>"  class="alignleft"><?php the_post_thumbnail('home-events-image'); ?></a>


                                <div class="alignleft info">

                                    <?php the_excerpt(); ?>

                                </div>

                                <div class="alignleft price">

                                    <p>Price: <?php echo "$" . tribe_get_cost(); ?></p>

                                </div>



                        </div>                      

                </div>

            </article>      
                    <?php

                    }


                    ?>

                    <?php   

                            if($events == null) {

                    ?>

            <article> 

                <div id="event-post-none"  class="alignleft">
                        <div class="aligncenter">

                            <p>There are no upcoming events. Please check back soon.</p>

                        </div>
                </div>                                          

            </article> 

                    <?php } ?>

        </div>

        <img src="<?php print IMAGES; ?>/upcoming_events-btm.png" title="Arctic playhouse shows"  class="alignleft upcoming" />

</div>

        <?php endwhile; endif; ?>

序列化数据?在找到这个方便的工具之前,我在迁移安装时遇到了很多问题。

Serialized Data Replacement

If you have created your test site with a different URL then the finishing live site which is more than likely, (unless you are using Virtual Hosts and are swapping between local and remote IP addresses) you may run into issues with some data not being migrated to the live site.

This data may include WordPress widgets not showing, certain plugins or theme data is missing. The reason this data may not have made the migration trip is because it is lost as the data has been serialized in the database with the old URL and then can’t be unserialized as there is a new URL.

我能解释的最好的是,每个 URL 在 SQL 数据库中都有一个序列化字符计数 - 通常在迁移到不同服务器时会发生变化。它打破了 $hit.

我可以通过更改

来修复它
'start_date' => strtotime($date->format('Y-m-d'))

'start_date' => strtotime(current_time('Y-m-d'))