我爲wordpress創建了一個自定義主題。當我說'添加新的'頁面,我把內容放入這個頁面時,它只顯示頁腳和頁眉,但是dosnt鉤住了我在該頁面的CMS中的內容。wordpress的自定義主題新頁面
這是我有:page.php文件
<?php get_header(); ?>
<div class="row">
<div class="col-sm-12">
<?php
if (have_posts()) : while (have_posts()) : the_post();
get_template_part('content', get_post_format());
endwhile; endif;
?>
</div> <!-- /.col -->
</div> <!-- /.row -->
<?php get_footer(); ?>
它是一個漫長的一天我錯了在這裏做什麼。請提供任何提示?
還想從這個新頁面中製作一個父頁面,但其唯一的選項與頁面屬性是'默認模板'。
好吧,你只加載模板的一部分,這你還沒有使用共享。該模板部分的內容是什麼?此外,我認爲你誤解了[get_post_format](https://codex.wordpress.org/Function_Reference/get_post_format)的作用 - 這不是正確的功能 - 可能你想[get_post_type](https://developer.wordpress.org/reference/functions/get_post_type /),這會導致一個模板名稱爲「content-page.php」 –