I'm trying to display a custom loop with a dynamic category filter.
As a setup I have categories of all usernames which are created once a user creates an account.
So I am trying to echo the user's username as a category filter. It works when I echo is elsewhere on the page, but it doesn't work when I try to embed it like so:
<?php query_posts('category_name=global $current_user; if ( isset($current_user) ) {echo $current_user->user_login;} &posts_per_page=10'); ?> &posts_per_page=6'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
<?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?>
<?php endwhile; else: ?>
NO Posts Present
<?php endif; ?>
Any help would be greatly appreciated, thanks.