I've added categories and tags to pages, but now I'm trying to add these to a page, but it doesn't show anything unless I add the category to a post...
Could someone take a look at what I'm doing wrong?
// The Query
query_posts( array ( 'category_name' => 'powershell-start', 'posts_per_page' => -1 ) );
// The Loop
while ( have_posts() ) : the_post(); ?>
<li>
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
</li>
<?php endwhile;
// Reset Query
wp_reset_query();
?>
EDIT: I'm sorry I notice im not clear. I'm trying to show a specific category on a page with the tilte and link to each page. But the above part only works when I add the category to a post instead of a page.
This is what I added to my functions.php:
/* add categories and tags to pages */
function add_taxonomies_to_pages() {
register_taxonomy_for_object_type( 'post_tag', 'page' );
register_taxonomy_for_object_type( 'category', 'page' );
}
add_action( 'init', 'add_taxonomies_to_pages' );