mizrach
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
Forum: Developing with WordPress
In reply to: query_posts in category with tagI changed the code to the following to use the query_posts($query_string. However, the $query_string is storing the “Java” category(. But in the “Best Practices” tab, all the post is under the “Best Practices” category with tag of “Java” and not the “Java” category. I want to navigate to the next page showing the next set of post under the “Best Practices” category with tag of “Java”.
I appreciate any help on this.
<?php if ($cat != 9 && $cat != 10 ) { ?> <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $offset = ($paged * 1); echo "page:" . $page; echo "offset:" . $offset . "<br />"; echo "querystring:" . $query_string . "<br />"; $this_category = get_category($cat); echo "querystring1:" . $ds_qry_string . "<br />"; $ds_qry_string = "&cat=8&showposts=1&offset=$offset&tag=$this_category->cat_name+$this_category->cat_name"; echo "querystring1:" . $ds_qry_string . "<br />"; query_posts("&cat=8&showposts=1&offset=$offset&tag=$this_category->cat_name+$this_category->cat_name"); // the Loop if (have_posts()) : while (have_posts()) : the_post(); ?> <a href="<?php the_permalink() ?>" rel="bookmark"><b><?php the_title(); ?></b></a> <?php the_content('Read the full post ?'); ?> <hr> <?php endwhile; else: ?> <p><?php _e('Sorry, there is no best practices yet in this category.'); ?></p> <?php endif; ?> <p><?php next_posts_link('« Older Entries'); ?></p> <?php } ?>
Forum: Developing with WordPress
In reply to: query_posts in category with tagI checked the usage section and followed it but it’s not working for me. Please see my category page in https://www.devstandards.org/category/application/java
Select Best Practices tab. When I click “Older Entries” it says “Not Found”.Please see my code below. I hope you can help me the problem.
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $offset = ($paged * 1); echo "page:" . $page; echo "offset:" . $offset . "<br />"; $this_category = get_category($cat); query_posts("&cat=8&showposts=1&offset=$offset&tag=$this_category->cat_name+$this_category->cat_name"); // the Loop if (have_posts()) : while (have_posts()) : the_post(); ?> <a href="<?php the_permalink() ?>" rel="bookmark"><b><?php the_title(); ?></b></a> <?php the_content('Read the full post ?'); ?> <hr> <?php endwhile; else: ?> <p><?php _e('Sorry, there is no best practices yet in this category.'); ?></p> <?php endif; ?> <p><?php next_posts_link('« Older Entries'); ?></p>
Viewing 2 replies - 1 through 2 (of 2 total)