• Resolved fasteddie10851

    (@fasteddie10851)


    I know, I know this question has been asked before but I cannot find a solution to my problem..

    Here is my code or page template

    <?php
    /**
     * Template Technology Posts
     *
     * The magazine page template displays your posts with a "magazine"-style
     * content slider at the top and a grid of posts below it.
     *
     * @package WooFramework
     * @subpackage Template
     */
    
     global $woo_options, $post;
     get_header();
    
     if ( is_paged() ) $is_paged = true; else $is_paged = false;
    
     $page_template = woo_get_page_template();
    ?>
    
            <!-- #content Starts
    	<?php woo_content_before();
    		?>
        <div id="content" class="col-full magazine">-->
    
        	<div id="main-sidebar-container">
    
                <!-- #main Starts -->
                <?php woo_main_before();
    	 ?>
                <section id="main">
    
    			<?php
    				woo_loop_before();
    
    				// Show page content first
    				/*if (have_posts()) { $count = 0;
    					while (have_posts()) { the_post(); $count++;
    
    						// Remove post more from page content
    						remove_action( 'woo_post_inside_after', 'woo_post_more' ); 
    
    						// Use business content so we don't output a page title
    						woo_get_template_part( 'content', 'page-template-business' ); 
    
    						// Add post more again
    						add_action( 'woo_post_inside_after', 'woo_post_more' );
    					}
    				}
    
    				// Load the Magazine Slider
    			    if ( $woo_options['woo_slider_magazine'] == 'true' && ! $is_paged ) {
    			    	if ( get_option( 'woo_exclude' ) )
    			    		update_option( 'woo_exclude', '' );
    			    	woo_slider_magazine();
    			        echo '<div class="fix"></div>';
    			    } 
    
    				// Load the magazine grid
    				get_template_part( 'loop', 'magazine' );  
    
    				woo_loop_after(); */
    			?>
    
                </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(); ?>

    What I want to do is put all the posts from category id 2 in this page template. I have tried several different ways with code but with no luck.

    I’ve tried

    query_post (‘cat=2’);

    But it doesn’t work

    I want the title if the post to show in an h2 tag, thumbnail if any to show, my author info with date and time, and just the excerpt.

    Any help, again sorry for posting about this subject but I can’t find a solution. I would just reference the category page which would resolve my issue but I want a custom sidebar for each of my category pages.

    Thanks

    Eddie

Viewing 4 replies - 1 through 4 (of 4 total)
  • You can of course query anything you want but if your main goal is custom sidebars, why not use a plug in like display widgets that will let you specify which widgets go on which category pages?

    Thread Starter fasteddie10851

    (@fasteddie10851)

    Which plugin do you suggest? I’ve tried some custom sidebar plugins and they require pages created. I was referencing domain/category/oneofmycategories in the nav bar to see the posts of the categories. But I could not edit the sidebar of these pages as they were not created in the pages section of the dashboard. This is why I thought of creating a template for each category so I could change the sidebar using a plugin.

    I use “Display widgets” which lets you hide/show sidebar widgets for pages, category pages, custom post types and individual posts.

    Thread Starter fasteddie10851

    (@fasteddie10851)

    Great, thanks. I use my iPad to do a lot of my work so when I installed custom sidebars it had a choice to put them on category pages but since the iPad does not use a mouse I did not understand that the selection for the custom sidebars was a drop down. But now I know and have abandoned the idea of a page template. I am using the archive page to display posts from each category and custom sidebar plugin to add my sidebars. A little CSS helped my style the archive page to make it look great for my site. Thanks for the help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add category to my page template’ is closed to new replies.