Sitemap

<?php/*Template Name: Sitemap*/?><?php get_header(); ?><div id=”mid-sitemap”> <h1 itemprop=”headline” class=”headxhouse”><?php the_title(); ?></h1><h2 class=”headxhouse”>Post</h2><div class=”sitemap-list”><?phpif (is_page()) :$args = array( ‘posts_per_page’ => ‘150’, ‘orderby’=> ‘rand’ );$glossaryposts = get_posts( $args ); endif;foreach( $glossaryposts as $post ) : setup_postdata($post);?><h2><a href=”<?php the_permalink(); ?>” title=”<?php the_title(); ?>”><?php the_title(); ?></a></h2><?php // create gallery automatically$images = get_children( array (‘post_parent’ => $post->ID,’post_type’ => ‘attachment’,’post_mime_type’ => ‘image’,));
if ( empty($images) ) { // no attachments here} else {
foreach ( $images as $attachment_id => $attachment ) { //generate seo alt image $attachment_meta = wp_get_attachment($attachment_id); $alt_title = str_replace(‘-‘, ‘ ‘, $attachment_meta[‘title’]); $arr_img = array( ‘alt’ => ucwords($alt_title), ‘title’ => ucwords($alt_title), );
echo ‘<a href=”‘ . get_attachment_link($attachment_id) . ‘” >’ ; echo $alt_title ; echo ‘</a> <br>’; } }?>
<?php endforeach; ?></div><div class=”cl”></div></div><?php get_footer(); ?>