WordPress.org

Ready to get started?Download WordPress

Forums

Custom Categories count on Same Page (1 post)

  1. abozabra
    Member
    Posted 3 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic