WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Blogging in sidebar (4 posts)

  1. Skyrider
    Member
    Posted 5 years ago #

    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!

  2. Jabbok
    Member
    Posted 5 years ago #

    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.»

  3. equaldesign
    Member
    Posted 5 years ago #

    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.

  4. Skyrider
    Member
    Posted 5 years ago #

    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; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic