• In the following line from index.php, I added a few non-breaking spaces to the $after argument to add some pseudo-padding when logged in as an admin or other contributor.

    How can I add and IMAGE to the $before argument? I want to add a preceding icon but ONLY when logged in as an admin or other contributor.

    <?php edit_post_link(‘Edit’, ”, ‘&nbsp;&nbsp;&nbsp;‘); ?>

Viewing 1 replies (of 1 total)
  • You could use something like:

    <?php if(  is_user_logged_in() ) echo '<span class="edit_logged_in">';?>
    <?php edit_post_link('edit', '', ''); ?>
    <?php if(  is_user_logged_in() ) </span>

    then in your stylesheet:

    .post-edit-link a {
    display:inline-block;
    padding-right:5px;
    }
    .edit_logged_in .post-edit-link a {
    padding-left:20px;
    background:url(images/icon.gif) left center no-repeat;
    }

    [ assuming a 16 x 16 icon in your theme’s images folder ]

Viewing 1 replies (of 1 total)
  • The topic ‘Help with post_edit_link() arguments’ is closed to new replies.