Quantcast
Viewing all articles
Browse latest Browse all 134520

EM4NU3L3 on "Help - Title list of posts of a specific category."

Hello, I need help to understand why this code doesnt work.

Actually it works, but if I change the category ID number doesnt work... the code shows all the titles of all the categories. Hope you understand me... here the code:

<?php
/*
Template Name: List of titles - posts of a specific category
*/

get_header(); ?>

		<div id="primary">
			<div id="content" role="main">

				<?php while ( have_posts() ) : the_post(); ?>

					<?php get_template_part( 'content', 'page' ); ?>

					<?php comments_template( '', true ); ?>

				<?php endwhile; // end of the loop. ?>

                        <?php $myposts = get_posts('numberposts=500category=1');
foreach($myposts as $post) : ?>
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
<?php setup_postdata($post); ?>
<?php endforeach; ?>

			</div><!-- #content -->
		</div><!-- #primary -->

<?php get_sidebar( $name ); ?>

Viewing all articles
Browse latest Browse all 134520

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>