use of query_post in template, please help
-
Hi there, i’m not a developer and just stumbled into a php issue i cannot resolve.
I have a template using the following php code to query posts on a specific category and show them in a table.
<?php query_posts(array( "cat" => 80, "orderby" => "date", "order" => "DESC", "posts_per_page" => -1 )); ?><?php $count_posts = $wp_query->post_count; ?>
<?php while (have_posts()) : the_post(); ?>
<!-- Getting Attachments -->
<?php
$args = array(
'post_type' => 'attachment',
'numberposts' => null,
'post_status' => null,
'post_mime_type' => 'application/pdf',
'post_parent' => get_the_ID()
);
$attachments = get_posts($args);
if ($attachments) {
foreach ($attachments as $attachment) {
$attachment_url = wp_get_attachment_url($attachment->ID);
}
}
?>So far it shows the posts under a category number that appears on the array.
I would like to modify this code in order to show the posts under any category that it’s being browsed, not a specific one.
This way i will be able to use it in category.php so all posts under any categories will be showed that way.
Is ther any body that can help me with this code? thanks in advance!
Francis
- The topic ‘use of query_post in template, please help’ is closed to new replies.