Hey stvwlf,
Thank you for replying and showing the code to use but your code differs from the code shown in the Codex template I am using, therefore I don’t know how to combine yours with it.
Here is the top section of code I am using. Just the top portion of it that I think you needed to reference if you wish to help me further.
<?php
/*
Template Name: PageOfPosts
*/
get_header(); ?>
<div id="container">
<div id="content">
<?php
// Page id 53 will get category ID 3 posts, page 55 will get category 10 posts and so on.
if (is_page('53') ) {
$cat = array(3,45,46,47,48,49,50,51);
} elseif ( is_page('55') ) {
$cat = array(10,40,15,41,42);
} elseif ( is_page('57') ) {
$cat = array(43,44);
} else {
$cat = '';
}
$showposts = -1; // -1 Shows all posts.
$do_not_show_stickies = 1; // 0 to Show stickies.
$args=array(
'category__in' => $cat,
'showposts' => $showposts,
'caller_get_posts' => $do_not_show_stickies
);
$my_query = new WP_Query($args);
global $more;
// Set $more to 0 in order to only get the first part of the post.
$more = 1;
?>
<?php if( $my_query->have_posts() ) : ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<?php
//necessary to show the tags
global $wp_query;
$wp_query->in_the_loop = true;
?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<!-- Display the post title in an h2 header. -->
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<div class="entry-meta">
<!-- I REMOVED THIS FOR BREVITY IN SHOWING YOU THE CODE -->
</div><!-- .entry-meta -->
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">»</span>', 'My-Framework' ) ); ?>
<?php wp_link_pages('before=<div class="page-link">' . __( 'Pages:', 'My-Framework' ) . '&after=</div>') ?>
</div><!-- .entry-content -->
NOTES: I already had the global $more added since I saw that in another post somewhere but they didn’t show how to use it, so for me – adding it did nothing.
You show additional code on how to actually use it but I don’t know how to integrate it into my current code. Could you help me some more please?
The code I added and saw from another post somewhere is:
global $more;
// Set $more to 0 in order to only get the first part of the post.
$more = 1;
You should be able to find it in the first code block I showed you.
Much aprpeciated stvwlf.
Thank you.