BCPower
Member
Posted 2 years ago #
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', '', ' '); ?>
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 ]