Archived

This topic is now archived and is closed to further replies.

  • 0

HTML Sitemap


Question

Posted · Report post

A while ago, Yoast, the developer of the great plugin Wordpress SEO, wrote an article on creating a HTML sitemap you can publish on your website for visitors. XML sitemaps are already provided by the Yoast plugin. The question is, how to create a custom PageLines Template for this page, including the suggested functionality provided by Joost de Valk (Yoast), to be embedded automaticly in the content area of this template?

I know how to create a custom PageLines template. But I don't know how to implement the php code yoast provided.

Anyone ideas for the right implementation?

Thank you.

Share this post


Link to post
Share on other sites

3 answers to this question

Posted · Report post


<?php

/*

Section: Sitemap Section

Author: Jbrouwer

Version: 1.0

Description: generates HTML sitemap

Class Name: sitemap

workswith: sitemap

*/

class sitemap extends PageLinesSection {

function section_template() {

?>

  <div id="pagelines_content" class="one-sidebar-right fix">

   <div id="column-wrap" class="fix">

    <div id="column-main" class="mcolumn fix">

	 <div class="mcolumn-pad">

	 <h2>Pagina's</h2>

	  <div class="pages">


	   <ul>

	   <?php

	   // Add pages you'd like to exclude in the exclude here

	   wp_list_pages(

		 array(

	    'exclude' => '',

	    'title_li' => '',

		 )

	   );

	   ?>

	   </ul>

	  </div>

	  <br>

	 <h2>Posts</h2>

	  <div class="posts">


	   <ul>

	   <?php

	   // Add categories you'd like to exclude in the exclude here

	   $cats = get_categories('exclude=');

	   foreach ($cats as $cat) {

		 echo "<li><h3>".$cat->cat_name."</h3>";

		 echo "<ul>";

		 query_posts('posts_per_page=-1&cat='.$cat->cat_ID);

		 while(have_posts()) {

	    the_post();

	    $category = get_the_category();

	    // Only display a post link once, even if it's in multiple categories

	    if ($category[0]->cat_ID == $cat->cat_ID) {

		  echo '<li><a href="'.get_permalink().'">'.get_the_title().'</a></li>';

	    }

		 }

		 echo "</ul>";

		 echo "</li>";

	   }

	   ?>

	   </ul>

	  </div>

	 </div>

    </div>

   </div>

   <?php get_sidebar();?>

  </div>


<?php



}

}

Share this post


Link to post
Share on other sites

Posted · Report post

thanks @jbrouwer, but how to implement? (new-custom sections are new to me)

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Perininero, have you considered contacting one of the Pagelines Pro's to help build you the custom section? www.pagelines.com/pros/

Share this post


Link to post
Share on other sites