• I would like to add a link to the write post form on the public site that will display when I am logged in so I don’t have to go to the admin site and then go to the new post form. I know, I know, its a few clicks, but it will also be easier for my wife.

    Is there a plugin out there for this or is it easy to add to the templates?

Viewing 5 replies - 16 through 20 (of 20 total)
  • I asked someone on MSN and they said this:
    <?php
    global $user_login;
    get_currentuserinfo();
    if ($user_login){
    echo '<a href="wp-admin/">Dashboard</a><br />
    <a href="wp-admin/profile.php">Edit my Profile</a><br />
    <a href="wp-admin/post.php">Submit an Article</a><br />'
    ;
    }
    else {
    echo '<a href="wp-register.php">Not Registered? Click here!</a>';
    }
    ?>

    Effectively the same. However, yours does let you customize the register link text by linking to wp-register.php manually.

    <?php if (isset($user_level)) {?>
    <li><a href="#">Howdy <?php echo $user_identity; ?>!</a></li>
    <li><a href='https://timskoch.com/wp-admin/post.php'>New Post</a></li>
    <?php } ?>

    I just implemented the above code in my site, and it works fine. But I have one problem: If I click the “New post” link, I’m asked to re-enter my login. Any ideas how to fix that?

    Oops, I found an easy fix: Use a relative link:

    <?php if (isset($user_level)) {?>
    <li><a href="#">Howdy <?php echo $user_identity; ?>!</a></li>
    <li><a href=/wp-admin/post.php'>New Post</a></li>
    <?php } ?>

    Duh…

    or how about this:

    <?php if (current_user_can(‘publish_posts’)) { ?>
    whatever whatever whatever
    <?php } ?>

    here’s a better explanation:
    https://boren.nu/archives/2005/12/01/whats-new-in-20-roles-and-capabilities/

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘Can I add a “new post” link on public site when logged in?’ is closed to new replies.