我爲wordpress構建了一個非常獨特和JavaScript密集的主題,現在短代碼不起作用。我沒有安裝任何插件,所以不是這樣。我從使用簡碼所需的wordpress模板文件中刪除了什麼(即:[gallery])。WordPress短代碼不能正常工作
我瞭解如何製作簡碼,但WP如何將您的帖子替換爲「[gallery]」,當它將它吐出顯示時?
編輯: 這裏是我目前正在工作:
$pagepull = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_type = 'page' AND post_status = 'publish' ORDER BY menu_order", ARRAY_A);
$i = 1;
foreach ($pagepull as $single_page){
echo "<div class=\"section\"><ul><li class=\"sub\" id=\"" . $i . "\"><div class=\"insection\">";
echo $single_page['post_content'];
$i++;
// more code that is irrelevant...
// more code that is irrelevant...
// more code that is irrelevant...
}
看看我的答案在下面! – keatch 2011-01-27 14:07:00
簡短回答:您正在使用原始內容($ single_page ['post_content']),而不是過濾後的內容:apply the_content filter。 echo apply_filters('the_content',$ single_page ['post_content']); – keatch 2011-01-27 15:30:19