Although Front-end Editor tries to be compatible with as many themes as possible, there’s only so much it can do.

No wp_footer() call

Lots of plugins, including this one, rely on the wp_footer() call to include their JavaScript files. Open your theme’s footer.php file and make sure you have this line somewhere:

<?php wp_footer(); ?>

Using the_title() in the wrong places

A mistake I see in a lot of themes is code like this:

<a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a>

This causes all sorts of problems. You should use the_title_attribute() instead:

<a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>

No id & class attributes for dynamic sidebars

If you want to have editable text widgets, you’ll have to change code like this:

register_sidebar(array('name' => 'My Sidebar',
	'before_widget' => '',
	'after_widget' => '',
	'before_title' => '<h4>',
	'after_title' => '</h4>',
));

to this:

register_sidebar(array('name' => 'My Sidebar',
	'before_widget' => '<div id="%1$s" class="widget %2$s">',
	'after_widget' => '</div>',
	'before_title' => '<h4>',
	'after_title' => '</h4>',
));

You can use <li>s instead of <div>s. The important part is id="%1$s" class="widget %2$s".

Reactions (2)

  • [...] who is the author of the Front-end Editor plugin that I reviewed in April 2009 has published some common mistakes found within themes. For some reason, themes sometimes don’t have the wp_footer template tag [...]

  • [...] Common Mistakes In Themes | scribu Scribu gives us some useful things to keep in mind when developing WordPress themes. Some things may no always seem necessary for your theme to work, but they are widely used in plugins and should definitely be included in your theme. Leave a Reply Click here to cancel reply. [...]

Comments (1)

  • Konstantin says:

    I agree. I hate when people don’t know the_ID() from get_the_ID().
    One of my favorites (I saw that A LOT) is in the archive.php:
    printf(__('Archive for the “%s” Category', 'domain'), single_cat_title());
    This will echo out the category title, and leave the parentheses empty..