Here is a foolproof way to make only parts of your site editable:

function front_editor_disable() {
	if ( ! is_single() )
		return true;
}
add_filter('front_end_editor_disable', 'front_editor_disable');

Just add that code in your theme’s functions.php file and you’re good to go: the plugin will work only on single posts.

Feel free to replace is_single() with whatever condition you need.

Comments (8)

  • The code you posted unfortunately doesn’t work! Have you changed the action name or class name by any chance?

    I tried to look into the code and see where you are hooking your scripts but I had little luck finding out how to do this!

    Do you have any ideas on how to do this even more foolproof? :)

  • Pavel says:

    Hi Scribu,

    is it possible to disable the Front End Editor only for one field on a page, and not for the whole page?

    For instane i want only the content of my page to be edited but not the title.

    Thanks in advance and great plugin!!! My compliments.

    Pavel from Italy

    • scribu says:

      Sure, just go to Settings -> Front-end Editor and uncheck the Post Title field.

      • Pavel says:

        Thanks a million for the quick answer.

        And what if I would like to disable the title editing only on page pages and not on the whole website?

        Settings -> Front-end Editor turns off all the fields of that type on the website but i would appriciate a way to filter this.

        Sorry, I’m a difficult user!!! ehehe

        Thank you for your time and again great job with yuor plugin!!