[英]WordPress Events Calendar PHP not working on Godaddy server, but works in WAMP localhost
This code works on my WAMP localhost, but not on the Godaddy server, I checked the php versions and they are the same, been having a tough time trying to figure out what the issue is. 这段代码可以在我的WAMP本地主机上运行,但不能在Godaddy服务器上运行,我检查了php版本,它们是相同的,一直很难找出问题所在。 Any one have suggestions?
有人有建议吗? Thank You
谢谢
website: http://www.thearcticplayhouse.com 网址: 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; ?>
Seralized data? 序列化数据? I've had so many problems migrating installations until I found this handy tool.
在找到这个方便的工具之前,我在迁移安装时遇到了很多问题。
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.
如果您使用不同的URL创建了测试站点,则创建的实时站点很有可能(除非您正在使用虚拟主机并且正在本地和远程IP地址之间进行交换),否则可能会遇到一些数据无法迁移的问题到现场。
This data may include WordPress widgets not showing, certain plugins or theme data is missing.
此数据可能包括未显示的WordPress小部件,缺少某些插件或主题数据。 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在数据库中进行了序列化,然后由于存在新的URL而无法反序列化。
The best I can explain is that every URL has a serialized character count in the SQL database - that changes upon migrating to different server, usually. 我能解释的最好的一点是,每个URL在SQL数据库中都有一个序列化的字符数-通常在迁移到其他服务器时会发生变化。 It breaks $hit.
它打破了$命中。
I was able to fix it by changing 我可以通过更改来修复它
'start_date' => strtotime($date->format('Y-m-d'))
to 至
'start_date' => strtotime(current_time('Y-m-d'))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.