2016-01-11 74 views
2

此代碼的工作在我的WAMP本地主機,但沒有GoDaddy的服務器上,我查了PHP版本和他們是一樣的,一直有一個艱難的時間,試圖找出問題所在。任何人都有建議?謝謝WordPress的活動日曆PHP,但在WAMP工作本地主機

網站: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; ?> 

回答

0

我能夠通過改變

'start_date' => strtotime($date->format('Y-m-d')) 

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

猜想,畢竟沒有工作,我的錯誤。 –

+0

好吧,刪除strtotime(),它似乎現在工作。橫過我的手指。 –

0

Seralized數據?直到找到這個方便的工具之前,我有很多遷移安裝的問題。

Serialized Data Replacement

如果你(除非你使用虛擬主機以及本地和遠程IP地址之間的交換)創建你的測試網站使用不同的URL,然後整理直播網站是更可能的,您可能會遇到一些數據未被遷移到現場的問題。

該數據可以包括WordPress的窗口小部件沒有顯示,某些插件或主題數據丟失。此數據可能沒有進行遷移行程的原因是因爲數據已使用舊URL在數據庫中進行序列化,並且因爲存在新URL而無法反序列化,所以數據丟失。

我能解釋的最好的一點是,每個URL在SQL數據庫中都有一個序列化的字符數 - 通常在遷移到不同的服務器時發生更改。它打破$打擊。

+0

我出口我的SQL數據庫修復它,然後使用這個工具,你送我,改名爲我的舊數據庫,並遠銷下載的文件進入新的數據庫,但它仍然在發生。 –

相關問題