A A A

Please consider registering
guest

Log In Register

Login form protected by Login LockDown.


Register | Lost password?
Advanced Search:

— Forum Scope —



— Match —



— Forum Options —




Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Sitemap code
November 20, 2009
2:48 pm
Member
Forum Posts: 20
Member Since:
May 3, 2009
Offline

I'm not sure if anybody is in need or wants to add a sitemap to there site.  If so here is a php file that will generate one.  After adding several hundred products to my site it was neccessary for me to make a sitemap for my website, and figured I would share with others that may find it of use.

Just save the file as sitemap.php and upload to you themes folder.  Next go and create a new page and select the page template that this file created "Sitemap".  That's it very easy and it will help your customers locate all your pages, and helps with search engines indexing your site. 

Here is what it looks like on my site.   http://www.stonesthatrock.net/sitemap

<?php
/*
Template Name: Sitemap
*/
?>

<?php get_header(); ?>
        
    <div id="content_box">

        <div id="content" class="page">
        
            <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
            
            <h1><?php the_title(); ?></h1>
            <div class="entry">
                <p><strong>All internal pages:</strong></p>
                <ul>
                    <?php wp_list_pages('title_li='); ?>
                </ul>
                <p><strong>All products:</strong></p>
                <ul>
                    <?php $archive_query = new WP_Query('showposts=1000');
                        while ($archive_query->have_posts()) : $archive_query->the_post(); ?>
                    <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a> </li>
                    <?php endwhile; ?>
                </ul>
                <p><strong>Product added in:</strong></p>
                <ul>
                    <?php wp_get_archives('type=monthly'); ?>
                </ul>
                <p><strong>Product Categories:</strong></p>
                <ul>
                    <?php wp_list_categories('title_li=0'); ?>
                </ul>
                <p><strong>Available RSS Feeds:</strong></p>
                <ul>
                    <li><a href="<?php bloginfo('rdf_url'); ?>" title="RDF/RSS 1.0 feed"><acronym title="Resource Description Framework">RDF</acronym>/<acronym title="Really Simple Syndication">RSS</acronym> 1.0 feed</a></li>
                    <li><a href="<?php bloginfo('rss_url'); ?>" title="RSS 0.92 feed"><acronym title="Really Simple Syndication">RSS</acronym> 0.92 feed</a></li>
                    <li><a href="<?php bloginfo('rss2_url'); ?>" title="RSS 2.0 feed"><acronym title="Really Simple Syndication">RSS</acronym> 2.0 feed</a></li>
                    <li><a href="<?php bloginfo('atom_url'); ?>" title="Atom feed">Atom feed</a></li>
                </ul>
            </div>
                
            <?php endwhile; endif; ?>
            
        
<?php get_footer(); ?>

November 20, 2009
4:01 pm
Admin
Forum Posts: 5051
Member Since:
March 16, 2008
Offline

Thanks a lot!  That's a great one to share.

November 23, 2009
12:54 am
Member
Forum Posts: 99
Member Since:
November 12, 2009
Offline

Thanks jayman

just added the sitemap to my site worked really well

Susan

February 13, 2011
3:44 am
Member
Forum Posts: 16
Member Since:
February 9, 2011
Offline

Exactly where do you place the code?  Do you find this themes folder in editor?  Could you be more detailed on the exact placement of your code, I am very new to this, 1 month in, as a matter of fact.  I find this code very valuable as my site is getting too large also. Piper

I can't believe how much I am learning from all the mistakes I make…Piper1
February 14, 2011
1:44 pm
Admin
Forum Posts: 5051
Member Since:
March 16, 2008
Offline

Save the above template as a file in your Market Theme files area.

 

Then, through your Wordpress administration area, create a new page named "site map" or whatever.  On that newly created page, choose the "Sitemap" page template and save.

Forum Timezone: UTC 0

Most Users Ever Online: 40

Currently Online:
22 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

icy1: 2371

wreed06: 175

laurie390: 168

StitchTek Services, LLC: 144

boutiqueelliette: 130

yiorgos: 127

Member Stats:

Guest Posters: 428

Members: 2252

Moderators: 1

Admins: 1

Forum Stats:

Groups: 1

Forums: 4

Topics: 2983

Posts: 16042

Moderators: Market Admin (5051)

Administrators: Market Admin (5051)

Market takes e-commerce to the next level with an easy to use, quick setup platform. Learn more or take the tour.