Jump to content
PeriniNero

HTML Sitemap

Recommended Posts

PeriniNero

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
jbrouwer

<?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
PeriniNero

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

Share this post


Link to post
Share on other sites
James B

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


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Similar Content

    • Jared Smith
      By Jared Smith+
      I haven't figured out how to get the "Sync Loaded Item" option in templates menu of Platform 5 to stay checked. It doesn't give me an option to save settings when I select it, and when I select it then click off the editor, it unselects. Also if I select it before loading a template, it doesn't stay checked there either.  Whats going on?
    • Queue-it
      By Queue-it+
      Hi,
      I created a Pagelines template for a "Post type" post. Whenever creating a new post page it firstly display that template post and I have to manually change it in the scope from "All of type posts " to "Current page". 
      Is there a way to fix that? 
       
       

    • richardjacruz
      By richardjacruz+
      I'm building a website in a dev environment at http://162.144.182.17/~uescocra.
      I want to import a bunch of products, and then have the products have a different template than the default template. 
      I also want to change the default template for blog posts.
      Before I go making changes, can I do this where the post type of "products" has its own global template, and the same with blog posts?
      For instance, in a product I might want to have a widget for categories, similar products, etc., and in the blog I may want list of the latest posts, blog categories, link to an email sign-up landing page, etc.
      Thanks.
      Rich
    • abuzzelli
      By abuzzelli+
      Is there a shortcode or a way to automatically pull the site name into the footer or elsewhere?
    • seanocaside21
      By seanocaside21+
      An old client of mine has come across an issue with their website. 
      The site is fine on the front end but when you log into the DMS editor the 'About' page template isnt available instead the template for the 'Print Services' page appears
      Here is the live About page http://www.digicom.ie/about/. And see attached file for what i see in the back end.
      In the page settings i can see that the wrong page template is active but I'm not sure how this is the case if the live page is correct. The client assures me they didnt activate the template. 
      Any help at all? 

×