1
我想學習這個東西,但有多種方法去皮膚貓。我在WP中有幾個帖子,用作主頁上的內容塊。對於每個塊,我使用WordPress的簡單方法,然後分別拉每個帖子ID?
<?php
$post_id = 34;
$queried_post = get_post($post_id);
$title = $queried_post->post_title;
echo $queried_post->post_content;
?>
然後在不同的區域,我使用
<?php
$post_id = 35;
$queried_post = get_post($post_id);
$title = $queried_post->post_title;
echo $queried_post->post_content;
?>
這是構建一個自定義主頁的正確方法?