使用Pods CMS与Roots Wordpress主题

时间:2013-04-02 07:01:28

标签: wordpress podscms

我在使用Roots Theme

在自定义Wordpress模板中显示Pod数据时遇到问题

我已经设置了一个“产品”Pod,一个已分配了自定义Wordpress模板的Pods页面“products / *”。 Roots使用的Theme Wrapper文件似乎不适用于Pods页面。有没有人遇到过这个问题,或许找到了解决办法?

2 个答案:

答案 0 :(得分:0)

您可以添加自定义模板,并将pods_content()放在要输出内容的位置。

或者您可以挂钩get_template_part_templates/content并检查“page”的第二个值,然后在那里运行pods_content()。

add_action( 'get_template_part_templates/content', 'hook_into_pods_page', 2 );

function hook_into_pods_page ( $slug, $name ) {
    if ( is_pod_page() && 'page' == $name )
        pods_content();
}

答案 1 :(得分:0)

我不知道这是否是一个“好”的解决方案。我昨天开始使用Wordpress。

那就是说,这是我的解决方案似乎运作良好。

在您的广告连播页面模板中,将页面的输出放入$ pods_content

$pods_content = $cookie->template('', get_pod_template('market-single'));
ob_start();
include get_stylesheet_directory() . '/base.php';
print ob_get_clean();

然后在base.php中用这个替换roots_template_path包含:

if ($pods_content): print $pods_content; else: include roots_template_path(); endif;