Wordpress create new <section> on site when a new page is added
<p>I'm trying to create a single page wordpress theme. Whenever I add a new page, I want a new  to be added to my Single page theme. I'm currently using this code:</p>

<pre><code>$pages = get_pages( array ( 'sort_order' =&gt; 'asc', 'sort_column' =&gt; 'menu_order', 'depth' =&gt; 1));

        foreach ( $pages as $page ) {  
        $page_section = str_replace( " ", "", strtolower( $page-&gt;post_name ) );

        echo '&lt;section id="' . $page_section . '" dataslug="' . $page_section . '"  &gt;&lt;/section&gt;';
        }
        ?&gt;
</code></pre>

<p>What I want is for it to create a new  with  an ID and Dataslug that match the page name (which is also the label on the link in the Menu). For example, say I insert a page called about, The menu item will read "about" and this code will be added to the page </p>

<pre><code>&lt;section id="about" dataslug="about"&gt;&lt;/section&gt;
</code></pre>
