0

I am having a hard time managing a big site with 2000+ pages.

Right now, I am restructuring the site architecture. So, for example, if there are categories like x, y, z... I want to put them under "A."

This A can be a page or a blog, but it should have a pagination (should update dynamically whenever a new post is added under x, y, z category).

Similarly, I want to put several other categories in "B."

I have tried various plugins, like posts to page, posts for page... and even List Categories with Pagination plugin. What I am looking for is another archive/blog page that lists the posts from defined categories.

Any help is highly appreciated.

Here is the template-blog.php file, if it helps.

   <?php
 /**
  * Template Name: Blog
  *
  * The blog page template displays the "blog-style" template on a sub-page. 
  *
  * @package WooFramework
  * @subpackage Template
  */

  get_header();
  global $woo_options;
 ?>      
<!-- #content Starts -->
<?php woo_content_before(); ?>


<div id="content" class="col-full">

    <div id="main-sidebar-container">    

        <!-- #main Starts -->
        <?php woo_main_before(); ?>


        <section id="main" class="col-left">

        <?php get_template_part( 'loop', 'blog' ); ?>

        </section><!-- /#main -->
        <?php woo_main_after(); ?>

        <?php get_sidebar(); ?>

    </div><!-- /#main-sidebar-container -->         

    <?php get_sidebar( 'alt' ); ?>       

</div><!-- /#content -->
<?php woo_content_after(); ?>

 <?php get_footer(); ?>

Edit: Going through Codex.WordPress, I see that there is a possibility:

$query = new WP_Query( 'cat=2,6,17,38' );

I wonder how to incorporate this code into my blog file.

Edit 2: Modified it this way, still doesn't work. Check edit 3.

Edit 3: Here is the loop-blog.php template.

<?php
/**
 * Loop - Blog
 *
 * This is the loop file used on the "Blog" page template.
 *
 * @package WooFramework
 * @subpackage Template
 */
global $more; $more = 0; 

woo_loop_before();

// Fix for the WordPress 3.0 "paged" bug.
$paged = 1;
if ( get_query_var( 'paged' ) ) { $paged = get_query_var( 'paged' ); }
if ( get_query_var( 'page' ) ) { $paged = get_query_var( 'page' ); }
$paged = intval( $paged );

$query_args = array(
                    'post_type' => 'post', 
                'paged' => $paged
            );

$query_args = apply_filters( 'woo_blog_template_query_args', $query_args ); // Do not     remove. Used to exclude categories from displaying here.

remove_filter( 'pre_get_posts', 'woo_exclude_categories_homepage', 10 );

query_posts( $query_args );

if ( have_posts() ) { $count = 0;
?>

<div class="fix"></div>

<?php
while ( have_posts() ) { the_post(); $count++;

    woo_get_template_part( 'content', get_post_type() );

} // End WHILE Loop
} else {
    get_template_part( 'content', 'noposts' );
} // End IF Statement

woo_loop_after();

woo_pagenav();
?>
1

This looks wrong:

if ($query->have_posts()) { $count = 0;
    while ($query->have_posts()) { the_post(); $count++;

Use this:

 if ($query->have_posts()) { $count = 0;
    while ($query->have_posts()) { $query->the_post(); $count++;
  • I have updated the files (some lines were missing). Even after messing with the file, adding the code you have mentioned I am not able to get it to work. Appreciate if you can look at it again. – Sid Jul 25 '13 at 8:51
  • 1
    Sorry. I didn't notice the WooFramework reference in your code (even though it is very obvious). Edit the post one more time, but add Woo Framework into the title to the question to (perhaps) Show Several Category Posts in Woo Framework Theme to attract people who know the Woo Framework. HTH – Charles Clarkson Jul 25 '13 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.