Viewing 5 replies - 1 through 5 (of 5 total)
  • 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?

    Thread Starter Marco Milesi

    (@milmor)

    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 https://www.website.com/sitemap_index.xml in a standard page!

    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 https://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

    Thread Starter Marco Milesi

    (@milmor)

    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: https://goo.gl/2fisD

    how and where do I have to include this code?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: WordPress SEO by Yoast] Display XML Sitemap in a page’ is closed to new replies.