我一直在努力将html页面转换为wordpress。我已经成功地转换了元素。但我的滑块有一个嵌入的youtube视频。下面的代码如果来自我的html主题
<iframe width="420" height="345"
src="http://www.youtube.com/embed/XGSy3_Czz8k">
</iframe>我想把这个youtube链接作为帖子。
我已经尝试过的
<?php query_posts('cat=3','&posts_per_page=1'); ?>
<?php while (have_posts()) : the_post(); ?>
<iframe width="420" height="345"
src="<? the_excerpt(); ?>">
</iframe>
<?php endwhile;?>发生什么事了?
我注意到,我的内存使用量迅速增加,并继续这样做,我从来没有得到视频。
原因是什么?我做错什么了吗?我的问题还有别的解决办法吗?
发布于 2014-01-24 12:26:20
尝试使用<? echo get_the_excerpt(); ?>代替<? the_excerpt(); ?>,因为the_excerpt()在屏幕上打印用<p>标记包装的节选,而get_the_excerpt()不带<p>标记返回它
https://stackoverflow.com/questions/21331710
复制相似问题