WordPress.org

Support

Support » Plugins and Hacks » Hacks » Custom Categories count on Same Page

Custom Categories count on Same Page

  • Hi

    Here’s my code:

    <?php if(is_user_logged_in()){ ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php include (TEMPLATEPATH . ‘/gallery.php’); ?>
    <?php endwhile; else: ?>
    <?php endif; ?>
    <?php } else { ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php include (TEMPLATEPATH . ‘/gallery.php’); ?>
    <?php endwhile; else: ?>
    <?php endif; ?>
    <?php } ?>

    What I’m trying to do is get a different count of Categories when users are not logged in.

    For example: when users are logged in the category will show the count from what’s configured within WP Blog pages show at most

    But when they are not logged in, it should show different count

    I tried most of what I found on the web but none work as intended.

    This code:

    <?php query_posts(‘cat=4&showposts=10’); ?> before the loop but this shows only cat 4 and not the latest posts form each category.

    Any help will be great. Thank you

    Sam

  • The topic ‘Custom Categories count on Same Page’ is closed to new replies.
Skip to toolbar