2015-11-01 74 views
0

我试图在Wordpress网站中的不同博客页面中使用滑块,但它不起作用。当我使用它时,它只显示纯文本:[metaslider id = 4281]滑块不显示图像,但纯文本

似乎“博客条目”不理解Metaslider代码,因为我试过了一个简单的页面,它的工作原理。这里有一个博客条目的代码(single.php中)

<?php get_header()?> 
    <div id="maincontent"> 
     <?php if (have_posts()) : while (have_posts()) : the_post(); //The Loop?> 
     <div <?php post_class()?>> 

<?php if(has_tag()){the_tags(_e('Keywords','polaroids') . ': ', ', ');}?><br/> 

<hr style="border: 0;border-bottom: 1px dashed #DDDDDD;"></br> 

      <h1><?php the_title()?></h1> 


      <div class="date"><?php /* the_date() */ ?></div> 

      <div class="post-content"><? echo $post->post_content; /*php the_content()*/ ?></div> 

      <div class="postfooter"> 
      <?php wp_link_pages('before=Pages&after='); ?><br/> 


      </div> 

<hr style="border: 0;border-bottom: 1px dashed #DDDDDD;"> 
<div class="breadcrumbs"><?php the_category(', '); ?></div> 
<hr style="border: 0;border-bottom: 1px dashed #DDDDDD;"> 


     </div> 

回答

0

我没有测试过这一点,但我怀疑呼应POST_CONTENT可能会返回纯文本。不知道为什么the_content被注释掉,但尝试使用它。

因此,不是这样的:

<? echo $post->post_content; /*php the_content()*/ ?></div>

尝试使用这样的:

<?php the_content(); ?>

+0

解决!非常感谢你Shoelaced! –

+0

快乐,很高兴它的工作! – Shoelaced