Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

nachoroberto98 on "How to make all Pages display on one page while retaining style and menu"

$
0
0

Someone posted this code, which when I paste it in the Page Template (page.php) works to make all of the pages display on one page (the parent page). Depending where in the template I paste it, it has a different influence (it seems to interfere with css). I am not sure where to paste it so all of the pages are presented in their original style (how they appear when I leave them as separate pages which I would load from the drop down menu). I'm currently using the Twenty Thirteen page template :

<?php $pages = get_pages();
foreach ($pages as $page_data) {
$content = apply_filters('the_content', $page_data->post_content);
$title = $page_data->post_title;
$slug = $page_data->post_name;
echo "<div class='$slug'>";
echo "<h2>$title</h2>";
echo $content;
echo "</div>";
}
?>


Viewing all articles
Browse latest Browse all 8245

Trending Articles