2011-09-06, 08:57:27
I am doing a site that has multiple pages on one page....is there a way I can load the home page via get_page_content and then use another function to get an about page or something like that?
Derek Wrote:I am doing a site that has multiple pages on one page....is there a way I can load the home page via get_page_content and then use another function to get an about page or something like that?
function get_content($page){
$item = array();
$path = "data/pages";
$thisfile = @file_get_contents('data/pages/'.$page.'.xml');
$data = simplexml_load_string($thisfile);
//print_r($data);
$item['content'] = stripslashes(htmlspecialchars_decode($data->content, ENT_QUOTES));
$item['title'] = $data->title;
$item['pubDate'] = $data->pubDate;
$item['url'] = $data->url;
$item['private'] = $data->private;
$item['parent'] = $data->parent;
$item['menuOrder'] = $data->menuOrder;
return $item;
}
$page = get_content('my-page');
echo $page['content'];
Derek Wrote:I am doing a site that has multiple pages on one page....is there a way I can load the home page via get_page_content and then use another function to get an about page or something like that?
<?php get_i18n_content('my-page-slug'); ?>
<?php
global $args;
if (count($args) > 0) get_i18n_content($args[0]);
?>