【发布时间】:2015-12-06 15:46:55
【问题描述】:
我有一个博客,它使用 wordpress 来显示帖子,而不是在首页上显示帖子,而是使用自定义模板(如 http://www.koolkatwebdesigns.com/blog/)用于桌面或非移动设备。对于移动设备,我正在使用带有包豪斯主题的 WPTouch Pro Plugin 无法显示帖子,仅显示页面标题,如下图所示:
page-2.php
<?php if ( foundation_is_theme_using_module( 'custom-latest-posts' ) && wptouch_fdn_is_custom_latest_posts_page() ) { ?>
<?php wptouch_fdn_custom_latest_posts_query(); ?>
<?php get_template_part( 'index' ); ?>
<?php } else { ?>
<?php get_header(); ?>
<div id="content">
<?php if ( wptouch_have_posts() ) { ?>
<?php wptouch_the_post(); ?>
<?php get_template_part( 'page-content' ); ?>
<?php } ?>
</div> <!-- content -->
<?php if ( wptouch_fdn_show_comments_on_pages() && ( comments_open() || have_comments() ) ) { ?>
<div id="comments">
<?php comments_template(); ?>
</div>
<?php } ?>
<?php get_footer(); ?>
<?php } ?>
我该如何解决?
【问题讨论】:
-
对于调试,您可以通过回显 hello
<?php echo " Hello "; ?>来查看它是否得到任何结果 -
@Steve 感谢您的帮助。我自己修好了。
-
有趣的是,如果你没有那个模块,我会建议
foundation_is_theme_using_module( 'custom-latest-posts' )可能是值得一看的——干得好! Echo hello 帮助我经常发现 WP 中发生的事情 - 事情并不总是像你想象的那样! -
@steve 是的。我没有使用 echo 来解决我的问题,只是查看了我的自定义模板脚本(用于桌面版)并在上面的脚本中添加了一些修改。
-
干得好 - 经常这样!
标签: php wordpress wordpress-theming