WordPress.org

Support

Support » Themes and Templates » [Resolved] Blogging in sidebar

[Resolved] Blogging in sidebar

  • Hi,

    I’m using a three column layout and I want to blog in all three columns. Therefore I want to make 2 extra categories, and like I’ve found here I want to use something like query_posts('cat=4'); in sidebar.php so I can blog in the sidebar.

    But I can’t get it work properly, I’ve tried to find a solution and looked things up about “The Loop” but it doesn’t work 🙁

    Can anybody help?
    Many thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • I know that the Sideblog plugin will allow you to establish a category named “Sideblog” and any post you make will be posted into the sidebar. I don’t know how it would work with two sidebars. I imagine it can be tweaked to post to “Sideblog1” and “Sideblog2”.

    I would start there.»

    Just run the normal loop in your sidebars but add this just before the loops in the sidebars:

    <?php query_posts('cat=4'); ?>

    changing the cat=4 to whatever category ID you want to show.

    Thanks, I tried it with the Sideblog plugin, but then I found the solution I wanted!
    This is what I meant 🙂

    <?php $my_query = new WP_Query('category_name=Lorum'); ?>
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    <span>All my desired stuff here</span>
    <?php endwhile; ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Blogging in sidebar’ is closed to new replies.
Skip to toolbar