WordPress.org

Ready to get started?Download WordPress

Forums

is user logged in (1 post)

  1. flabrea
    Member
    Posted 3 years ago #

    <?php
    if ( is_user_logged_in() ) {
    echo 'Welcome, registered user!';
    } else {
    echo 'Welcome, visitor!';
    };
    ?>

    i would like to use the php thing below for logged in users

    <?php
    $rand_posts = get_posts('numberposts=1&orderby=rand');
    foreach( $rand_posts as $post ) :
    ?>
    ">
    <?php meta('textdate'); ?>

    <?php endforeach; ?>

    how can this be done. using the code results in a blank page. doesn't work.

    thanks! flo

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.