繁体   English   中英

Index.php不在首页显示我的新修改

[英]Index.php doesn't show my new modify in home page

我有这个index.php:

<?php
    //Getting Header
    get_header();
?>

    <div><h1>DOG</h1></div>

<!-- This do this function -->
    <!-- Content section -->
    <div class="content-section module blog-page">
        <div class="row">
            <?php
                $object_id = get_queried_object_id();

                //Getting Single Post Sidebar Position 
//yes
                $wc_sidebar_position_default = get_theme_mod("wc_blogsection_manage_sidebar");
                $wc_sidebar_position_special = get_post_meta($object_id, "wc_innerpage_sidebar_position", true);

                if($wc_sidebar_position_special == "left_sidebar"  || 
                   $wc_sidebar_position_special == "right_sidebar" || 
                   $wc_sidebar_position_special == "disable_sidebar") { 
                    $wc_sidebar_position = $wc_sidebar_position_special;
                } else { 
                    $wc_sidebar_position = $wc_sidebar_position_default;
                }

                switch($wc_sidebar_position) { 
                    case "left_sidebar":
                        //left sidebar
                        get_sidebar();
                        //Getting posts sides
                        get_template_part('template-parts/post-type/blog');
                    break;

                    case "right_sidebar":
                        //Getting posts sides
                        get_template_part('template-parts/post-type/blog');
                        //Right Sidebar
                        get_sidebar();
                    break;

                    case "disable_sidebar":
                        //Getting posts sides
                        get_template_part('template-parts/post-type/blog'); 
                    break;

                    default:
                        //Getting posts sides
                        get_template_part('template-parts/post-type/blog');
                        //Right Sidebar
                        get_sidebar();
                }//Ends Switch
            ?>
        </div><!-- Row Ends /-->
    </div>
    <!-- Content Section Ends /-->

<?php
    //Getting Footer
    get_footer();

我想在页眉后的页面中读取“ DOG”,但重新加载页面时却什么也看不到,我也不知道为什么。 谁能帮我?

尝试将<div><h1>DOG</h1></div>移至div <div class="content-section module blog-page"> ,以使其看起来像这样:

<div class="content-section module blog-page">
<div><h1>DOG</h1></div>
...

现在可见吗?

index.php可能不会提供您的主页。 可能还会显示其他几个可能的模板文件。

例如,如果您的主题具有front-page.php,则该文件就是您要编辑的文件。 或者,如果主页作为带有自定义页面模板的页面运行,则可能正在寻找诸如template-home.php之类的东西。 就像以前的评论者所说的那样,很难说出确切的内容而没有看到站点/代码。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM