Support » Themes and Templates » Filter by User Name

  • Hello:

    I have a link that varies by user.
    For now, it is work filtering by user id, but I need the code filter by username.

    My actual code is:

    <?php $user_id = get_current_user_id();
    if ($user_id == 6) {
    echo '<a title="Download" href="" rel="nofollow">';
    } else {
    echo '<a title="Download" href="" rel="nofollow">';}?>
    <img src="" width="250" height="48" />
    <?php global $post; $myposts = get_posts('numberposts=1&category_name=download'); foreach($myposts as $post) : setup_postdata($post);
     if(has_post_thumbnail()) {the_post_thumbnail();}
     endforeach; ?>

    Thank you!

  • The topic ‘Filter by User Name’ is closed to new replies.