WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
Display XML Sitemap in a page (6 posts)

  1. Marco Milesi
    Member
    Posted 2 years ago #

    Hello Everyone.

    Is it possible to put the XML Sitemap generated by the plug-in in a "Standard" page (or with PHP code) in WordPress?
    If Yes, How..?

    Thanks in advance!

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. namebadgesdirect
    Member
    Posted 2 years ago #

    Similar problem.

    I want to view it in the browser... Why is this so hard for someone to show us how to view it in the browser or some other way?

  3. Marco Milesi
    Member
    Posted 2 years ago #

    I still need this help! Some months ago i tried some plugins, but i don't like to install too many of them so i need to view http://www.website.com/sitemap_index.xml in a standard page!

  4. twanny
    Member
    Posted 2 years ago #

    I cant believe that a simple option like displaying the site map in a page couldnt be incorporated in this plugin. !!! I am trying to keep the amount of plugins used in a website to a minimum but I am using plugin http://www.presscoders.com/plugins/simple-sitemap/ just to display the map. Would be nice if this functionality is included in WP SEO :)

    Many thanks for the plugin

  5. Marco Milesi
    Member
    Posted 2 years ago #

    Hi twanny!
    I asked that question 6 months ago... In this long time i've found a simple way without using any plugin!
    Maybe this could be helpful for you to solve the problem:

    <h2>PAGES</h2>
    <ul>
    <?php
    // Add pages you'd like to exclude in the exclude here
    wp_list_pages(
      array(
        'exclude' => '',
        'title_li' => '',
      )
    );
    ?>
    </ul>
    <h2>POSTS</h2>
    <ul>
    <?php
    // Add categories you'd like to exclude in the exclude here
    $cats = get_categories('exclude=');
    foreach ($cats as $cat) {
      echo "<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 "";
    }
    ?>
    </ul>

    You can see the example here: http://goo.gl/2fisD

  6. kletskater
    Member
    Posted 2 years ago #

    how and where do I have to include this code?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic