Post list had problem on my page with Polylang, in default language returned nothing, but on second language showing both languages.
I modified function to query post as follows
function sbwpes_sitemap_post() { ?>
<h2><?php _e('Products', 'easy-sitemap' ); ?>:</h2>
<ul class="sitemap">
<?php $loop = new WP_Query( array(
'post_type' => 'post',
'posts_per_page' => 1000,
'orderby' => 'title',
'order' => 'ASC'
) ); ?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<li><?php the_title( '<a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a>' ); ?></li>
<?php endwhile; ?>
</ul>
<?php
}
add_shortcode( 'SitemapPost', 'sbwpes_sitemap_post' );
]]>
I want the sitemap to only show
products and categories that are available to the current user.
Furthermore, to show only categories, that have actual products in them.
Is that possible?
]]>