0
我想只顯示從一個站點到另一個站點的特定內容。WordPress的:從另一個頁面獲取指定的內容
例如:
我想在<div>
@其他頁面中顯示一些文本。
頁答:
<h2>This is page A</h2>
<div id="showonly">This is the content I want to show in footer for ex.</div>
頁腳:
現在我想只顯示與此特定ID股利。
我做了什麼至今:
這是我從頁面獲取內容(全部內容)
function show_post_leweb($path) { $post = get_page_by_path($path); $content = apply_filters('the_content', $post->post_content); echo $content; }
在footer.php我沒有那麼功能:
$content_leweb = show_post_leweb('kontakt'); echo '<div class="special-content">' .$content_leweb . '</div>';
工作正常,但我只需要一個特定的div而不是整個頁面,就像我上面提到的那樣。