【发布时间】:2014-10-07 23:29:29
【问题描述】:
我正在使用在 24 个 Wordpress 主题中作为标准提供的特色内容滑块。它几乎完成了我现在想做的所有事情,并且我使用 CSS 对其进行了一些基本的自定义,但是在与内部的一些人交谈后,他们希望将其“插入”到页面的主要内容区域。
我环顾四周,发现一个建议更改 index.php 文件以更改注册特色内容的 PHP 语句的位置。在对我的子主题进行这些更改并发布它们之后,什么也没发生。
我完全不知道下一步该往哪里看或要改变什么(没有可能破坏一切的反复试验!)
这可能是一个非常简单的解决方案,我完全忽略了如果是这种情况,我深表歉意。这是一个内部网站,所以很遗憾我无法提供任何链接。非常感谢您的帮助!
Index.php 当前代码:
get_header(); ?>
<div id="main-content" class="main-content">
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php
if ( have_posts() ) :
// Start the Loop.
while ( have_posts() ) : the_post();
/*
* Include the post format-specific template for the content. If you want to
* use this in a child theme, then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
<?php
if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
// Include the featured content template.
get_template_part( 'featured-content' );
}
?>
此外,特色内容当前位于页面顶部,不适合内容和主侧边栏(它位于主侧边栏右侧的内容侧边栏上方。
【问题讨论】: