Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
One-Page-Template-> automatically include new pages in a div
#34
(2012-04-14, 19:42:59)Carlos Wrote: A way to have a one-page site with anchors (for GS 3.1):

Insert this code in your template (e.g. before, after, or instead of the <?php get_content(); ?> tag).
Code:
<?php
global $pagesArray;
$pagesSorted = subval_sort($pagesArray,'menuOrder'); // or 'title', 'menu', 'url', ...
foreach ($pagesSorted as $page) if ($page['url']!='index' && $page['menuStatus']=='Y') {
   $pag = $page['url'];
?>

<a name="<?php echo $pag; ?>"></a>
<div class="pagecontent <?php echo $pag; ?>">
   <h2><?php getPageField($pag,'title'); ?></h2>
   <?php getPageContent($pag); ?>
</div>

<?php } ?>

Thank you, this saved me

In my single page site I also need a redirect to external site for a couple of link, so my question is:
there is a way to add the function for checking if the keywords field on the page is empty or not? if is empty the variable ?pag is = to slug url , if is filled (with the url I need) the variable $pag is = at the content of the field

sorry for my bad english
Reply


Messages In This Thread
RE: One-Page-Template-> automatically include new pages in a div - by Sonny - 2017-03-15, 06:47:16



Users browsing this thread: 1 Guest(s)