我正在使用OptionTree for WordPress選項面板,我正在獲取頁面ID,並使用該頁面ID來填充頁面的內容到另一頁面。這裏是我的代碼:如何在WordPress中將頁面內容填充到另一個頁面
<?php
$test_input = ot_get_option('for_myapp_features');
?>
<?php $the_query = new WP_Query('page_id=$test_input'); ?>
<?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
<?php the_title(); ?>
<?php the_excerpt(); ?>
<?php endwhile;?>
任何幫助將有所幫助。
你試過這個嗎? 'echo get_post_field('post_content',$ test_input);' –
@RaunakGupta謝謝,獲取內容,讓我知道如何獲得標題? –