我正在使用“二十十四个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' );
}
?>
此外,“特色内容”当前位于页面顶部,不适合内容和主要侧边栏(位于内容侧边栏上方,位于主侧边栏的右侧。
最佳答案
如果您担心破坏在线站点,则应复制现有内容,然后将其本地安装在计算机上。
如果您正在运行Windows,WAMP对此非常有用,并且可以使您的计算机像Apache Web服务器一样工作。
接下来,如果您可以提供一些代码来显示特色内容滑块的位置,这将很有帮助。
还要确保您正在为主题编辑正确的文件。