One Category on the Side and in the BLog, with category visibility plugin (1 post)

  1. acousticdryad
    Posted 8 years ago #


    I use the category visibility plugin, which is fairly crucial for my site (and why I haven't upgraded, since the plugin is not compatible with the newer version of WP).

    I want to list the last 10 posts of one category on a side bar, and list the posts from all other categories that I allow to be seen on the main page, in the blog portion like normal.

    I actually do this on my regular blog at http://tawodi.org

    However, I am unable to duplicate this because on this other site, I use the category visibility plugin.

    Here is the code on the journal that WORKS. Keep in mind that my journal does not use the category visibility plugin.

    Note: The problem is that it will display the latest 10 posts on the sidebar, like I want, but then will not show any in the blog at all.

    Code for the sidebar

    <?php query_posts('category_name=blog&showposts=10'); ?>

    <?php while (have_posts()) : the_post(); ?>
    <div class="entries">
    " rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?>
    <?php endwhile;?>

    And then code for the blog:

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <?php if ( !(in_category('29')) ) { ?>

    <div class="entries">
    <h2><?php the_title(); ?></h2>
    <p class="small">
    <?php the_time('F') ?> <?php the_time('jS') ?> <?php the_time('Y') ?>

    <?php the_content('<p class="invite">Read the rest of this entry</p>'); ?>

    <div class="related">Related Posts:
    <?php related_posts(); ?></div>

    <p class="postStats">
    <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>

    " rel="trackback" title="Permanent Link to <?php the_title(); ?>">Link | <?php edit_post_link('Edit','','|'); ?> Posted in <?php the_category(', ') ?>

    <?php } ?> <!-- Close the if statement. -->
    <?php endwhile; ?>

    Now I will note, in this other site, the code for the blog portion looks like follows:

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

    <?php if (in_category('22') || in_category('24') || in_category('20') || in_category('19') || in_category('21') || in_category('23') || in_category('16') || in_category('14') || in_category('15') || in_category('12')) continue; ?>

    <div class="entries">
    <div class="columnInnardsContent">
    <span class="title">
    <?php the_time('F') ?> <?php the_time('jS') ?> <?php the_time('Y') ?>

    <?php the_content('Read the rest of this entry »'); ?>

    " rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Link | Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit','','|'); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>

    <?php endwhile; ?>

    <?php else : ?>
    <h2 class="center">Not Found</h2>
    <p class="center">Sorry, but you are looking for something that isn't here.</p>
    <?php endif; ?>

    So I'm not sure if the if_category portions at the top of that have anything to do with it.

    Any help would be appreciated, I've been mussing with this for a while now and can't seem to figure it out.

Topic Closed

This topic has been closed to new replies.

About this Topic