I was trying to make a navigation menu of all the anchor links on a page (similar to wikipedia) but couldn't find out how. I tried to find a plugin that could do it, but they only listed the anchors of a single post.
I made a custom page with the following code:
get_header(); ?>
<main id="content" class="site-content" role="main">
<?php query_posts('category_name=Artemis-Header'); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; // end of the loop. ?>
<?php query_posts('category_name=Artemis'); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
</main><!-- #content .site-content -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
and it displays a header, followed by all the posts that are part of the category "Artemis". When on this page, I'd like there to be a list of anchor links to all of the posts (later I'll move those links to a fixed sidebar, to make navigation easy).
Any help would be appreciated
get_posts
instead of query_posts like that. codex.wordpress.org/Template_Tags/get_posts