简体   繁体   English

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

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

I have this index.php: 我有这个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();

I want read "DOG" in my page after header but I don't read anything when I reload the page and I don't know why. 我想在页眉后的页面中读取“ DOG”,但重新加载页面时却什么也看不到,我也不知道为什么。 Can anyone help me? 谁能帮我?

Try moving the <div><h1>DOG</h1></div> inside of the div <div class="content-section module blog-page"> for so it looks like this: 尝试将<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>
...

Is it visible now? 现在可见吗?

Your home page may not be served up by index.php. index.php可能不会提供您的主页。 There could be several other possible template files that would display instead. 可能还会显示其他几个可能的模板文件。

For example, if your theme has a front-page.php, that would be the file you'd want to edit. 例如,如果您的主题具有front-page.php,则该文件就是您要编辑的文件。 Or, if the homepage is running as a page with a custom page template, you might be looking for something like template-home.php. 或者,如果主页作为带有自定义页面模板的页面运行,则可能正在寻找诸如template-home.php之类的东西。 Tough to say exactly without seeing the site / code, just like a previous commenter said.. 就像以前的评论者所说的那样,很难说出确切的内容而没有看到站点/代码。

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

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