wesburke
Member
Posted 3 years ago #
Hello,
I have a few custom page templates that I am using at http://www.cgcookie.com to help set my current nav in the header, and retain some control of what content is included.
I am looking to create a new page now that says pulls all posts from X categorie/s? I would imagine I would have to modify the code from the index or archive page, but not too savey on the code side of things.
Any suggestions or tips on how to accomplish this?
Example:
http://www.cgcookie.com/articles/3d-studio-max This page I will need it to pull all posts from the 3D Studio Max Category, and any subs.
Thank you in advanced.
wesburke
Member
Posted 3 years ago #
So far I have been able to pull the posts into the static page by adding this:
<?php query_posts('cat=123'); ?>
Above
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
The issue I am running into now is that the_content() seems to be ignoring my <!--more--> tags in all of my posts and pulls the full post.
I have to be just missing some small thing... Any ideas?
W
wesburke
Member
Posted 3 years ago #
Hey guys,
I wanted to bump this and update as well that so far I am still running into the issue of it displaying the entire post vice stopping at the <!--more--> tag..
Suggestions? Links to read up on?
W
When you bump a post, we think you have gotten a response. Please don't do that.
It sounds like you want to setup a site map or table of contents type of page. There are many Plugin options that help you do that. Have you searched through the Plugin Directory with those keywords?
Also, considering asking the Theme developers for help on this, since they are the supplier of your Themes.
I think this is what you're looking for:
<?php
// retrieve posts from Cat 123
query_posts('cat=123');
global $more;
// set $more to 0 in order to only get the first part of the post
$more = 0;
// the Loop
while (have_posts()) : the_post();
// the content of the post
the_content('Read the full post ยป');
endwhile;
?>
Taken from the query_posts section of the WP Codex.
wesburke
Member
Posted 3 years ago #
@ Lorelle I applogize for the bump post and will refrain from doing that in the future.
@dbmartin Thank you for the code. I just plugged this into the site and it appears to work great now. I was missing the global $more in there. Once I added that all was well. I appreciate the help and kindness.
Cheers,
W