DEV Community

kumamon
kumamon

Posted on

WordPressで固定ページのコンテンツ内容を読み込むPHP

<?php
$page_data = get_page_by_path('ここにページネーム'); $page = get_post($page_data);
$content = $page -> post_content;

echo $content; 
?>

あとは、single.phpなどの任意の場所へ貼り付け

Top comments (0)

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay