Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
One-Page-Template-> automatically include new pages in a div
#17
Here's a modified version of the script, that works (for me) with I18N Gallery when using the (% gallery ... %) placeholder.

- If you don't have a functions.php file in your theme, create one with this content:
Code:
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }

- Insert this in the functions.php file:
Code:
$content = '';
$pagesSorted = subval_sort($pagesArray,'menuOrder'); // or 'title', 'menu', 'url', ...
foreach ($pagesSorted as $page) if ($page['url']!='index' && $page['menuStatus']=='Y') {
    $pag = $page['url'];
    $content .= '
<a name="'.$pag.'"></a>
<div class="pagecontent '.$pag.'">
    <h2>'.returnPageField($pag,'title').'</h2>
    '.returnPageContent($pag).'
</div>
';
}
(if you had customized the foreach, etc., you know what you have to change there.)

- If you were using the previously posted script in the template, remove it and put <?php get_page_content(); ?> instead.

If not, you don't need to touch your template. But you have to:

- Go to Admin > Settings and set your Custom Permalink Structure to:
Code:
#%slug%

(I've done just a quick test with this... backup before trying...)
Reply


Messages In This Thread
RE: One-Page-Template-> automatically include new pages in a div - by Carlos - 2014-03-15, 05:34:15



Users browsing this thread: 1 Guest(s)