Foliovision Logo

Front End Editing

If you've picked up an older WordPress theme, you might just be missing a key feature included in most recent themes. And this feature is essential to CMS nirvana.

Front end editing.

What's front end editing?

Front end editing is being able to navigate the site from the front end - like an end user - and just click a button, edit your post and go back to the front end.

Here's what it looks like on this weblog (you won't see it as you are not logged in and are unlikely to be in the future unless you work for Foliovision):

front end editing wordpress
front end editing wordpress

Here it is actually at the bottom of a post.

I prefer the edit button at the top of a post actually.

To add it to your posts and pages, you have to open up the following file in your WordPress template:  page.php.

The full path is: /wp-content/themes/yourtheme/page.php

Here is the code you need to paste in:

<p><?php // the edit link 
edit_post_link(__('Edit','drunkey-love'),'','');
// end of edit link
?></p>

You should paste it at the top of your page.php file.

Here's what my finished page.php looks like for a new site: 

<?php get_header(); ?>

<div id="content">

<?php include(TEMPLATEPATH."/sidebar.php");?>

<div id="contentmiddle">

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h1><?php the_title(); ?></h1>

<p><?php // the edit link
edit_post_link(__('Edit','drunkey-love'),'','');
// end of edit link
?></p>


<?php the_content(__('Read more'));?>
<!--
<?php trackback_rdf(); ?>
-->

<?php endwhile; else: ?>

<p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>
</div>

</div>

<!-- The main column ends -->

<?php get_footer(); ?>

With this code, if you are logged in you can now navigate to any page and edit on the spot. Your clients can too.

Everyone is happy.

For those who are not happy editing PHP (me until recently), here's a zipped version of page.php which you can try replacing in your your theme directory /wp-content/themes/yourtheme/ .  It will  probably work.


Tags: ,

del.icio.us Digg Ma.gnolia StumbleUpon Technorati Jump to the top of this page

 

One comment on “Front End Editing”

  1. 01

    […] Front Editing for WordPress. By Alec Tags: none […]

    Front End Editing for WordPress at December 12th, 2007 around 9:00 am
    Jump to the top of this page

Leave a Reply

  •  
  •  
  •  

You can keep track of new comments to this post with the comments feed.

Section Contents

Recent Posts

Recent Comments:

  • How to Convert a Clone CD Image to ISO (27)
  • devin: “Hey Alec, Well, it had also said that sudo (and port) were unrecognized commands. For instance, sudo install ccd2iso gave me an unrec....”
  • devin: “Actually, got that worked out…but can’t seem to get ccd2iso running. It’s an “Unrecognized action.” >...”
  • devin: “So…this is all very much out of my depth and I’m sure I’m missing something obvious, but… …when I try to...”
  • How to Comment Code in WordPress Templates (3)
  • Chris: “Thanks this really helped out!”
  • Embedded Menus Plugin (5)
  • Ale: “Thanks so much! It’s perfect. And thank you for the tip about the Pro version, as well. I’ll consider the possibility of...”