Skip to content

Instantly share code, notes, and snippets.

@astockwell
Created May 30, 2013 18:13
Show Gist options
  • Save astockwell/5679882 to your computer and use it in GitHub Desktop.
Save astockwell/5679882 to your computer and use it in GitHub Desktop.
Creates edit post/page button in wordpress (only displays if user is logged in) so you can hide the terrible admin bar.
<!-- Place in "body > header" or equivalent -->
<?php edit_post_link( __('Edit'), '<span class="edit-link">', '</span>' ); ?>
.edit-link {
position: absolute;
top: 0;
right: 0;
a {
display: block;
padding: 1px 5px;
color: white;
background-color: blue;
text-decoration: none;
text-shadow: rgba(black, 0.2) 0 1px 0;
&:hover {
background-color: #333;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment