3 WordPress Title Box Hacks

These 3 title box snippets (all tested with the Twenty Eleven theme’s functions.php on WP 3.4.1) will let you customize your “New Page” or “New Post” title areas.
Change default “Enter title here” text for Posts and Pages

1
2
3
4
function title_text_input( $title ){
return $title = 'What are you feeling?';
}
add_filter( 'enter_title_here', 'title_text_input' );

Source: WPSnipp.com

It works for both Posts and Pages.

Change default “Enter title here” text for Custom Post Type Posts

1
2
3
4
5
6
7
8
function change_default_title( $title ){
$screen = get_current_screen();
if  ( 'pricing_table_post_type' == $screen->post_type ) {
$title = 'Enter Pricing CPT Title';
}
return $title;
}
add_filter( 'enter_title_here', 'change_default_title' );

Source: WPSnipp.com

WordPress Post Title Snippets

Read more »

Improve WordPress Visual Editor for any theme with Editor Stylesheets

What good is a WYSIWYG editing interface if it fails to show what your marked-up content really looks like? Many themes do not make use of editor styles, even though they’ve been available since WordPress version 3. Let’s cover how to:

Enable editor style sheets in your theme.
Tell your theme to acknowledge the editor style sheet.
Then port over your theme’s post CSS to make your editing screen snazzy (and correct.)

Editor stylesheets: an egg is an egg

Editor Stylesheets -- Stylish model symbolizing styled content

Read more »

Why You Hate The WordPress Text Editor and What To Do About It

<rant>There is a lot to not love about TinyMCE – the open source text editor that is used in WordPress. I’ll start. Who here thinks that this is an ample number of buttons for a WYSIWYG text editor?And on a similar note, someone needs to have a rethink about naming the second row of buttons the “kitchen sink”:When I read “kitchen sink”, I picture every possible WYSIWYG function under the sun. Not a few bonus buttons.A few weeks ago, I canvassed our ever-helpful Facebook fans for their thoughts on TinyMCE and received a rather overwhelming response:It removes <div style=”clear: both”></div> or any other code for that matterNo HTML view while in full screen modeThe way it handles <br />, &nbsp; and paragraphs drives me crazyWhen I add captions to pictures, the pictures move up automaticallyPeople are afraid to move back and forth from Visual Editor to HTML modeYou can’t embed tables easilyFull screen mode doesn’t have the kitchen sinkManaging content on iPad or iPhone is painfulLine numbers would be niceIt doesn’t allow you to do a carriage return in the Visual EditorRandom <div> creation destroys paragraph spacingThe list went on. One of the oft-repeated complaints was that it is just too damned basic. And you know what’s funny? TinyMCE just wrapped this paragraph in <div> tags (which it always does after creating a list). So I will now have to manually remove those tags using the HTML editor. Which will return to the top of the screen when I click on it. Grrr…</rant>Alright, so that’s enough moaning for the time being. There are ways of addressing some of these problems – in fact, I have 4 for you today.1. TinyMCE AdvancedMost people are familiar with TinyMCE Advanced – for most experienced WordPress users, installing this plugin is one of the first things they do when setting up a new site. It has some great features:It imports CSS classes from your theme’s style sheet into a drop down menuButtons for making tablesA real HTML editorSuperscript and subscriptThere are plenty of other features. Many argue that TinyMCE Advanced should be packaged with WordPress as standard. It is difficult to argue with them – it would certainly be an improvement at the very least.2. Ultimate TinyMCETinyMCE Advanced is not the only available alternative. Hot on its heels, with a near-perfect rating in the WordPress Plugin Directory, is Ultimate TinyMCE. This plugin actually takes things to another level with some pretty interesting features:Advanced features for images (such as mouseover and mouseout)Easily add page anchors to posts that become too long to scroll through all the content.Use image mapping to create separate links over the same image. Great for using photoshop images as navigation.Check out this video for a showcase of what Ultimate TinyMCE can do:http://youtu.be/01reHnBCAIAIt may just have the beating of TinyMCE Advanced. Not to mention the fact that it is being developed by a highly enthusiastic guy who is working hard on regular updates. It has just 75,000 downloads to date, compared with TinyMCE Advanced’s 1,275,000, but that gap will no doubt start closing soon.3. CKEditorOf course, another alternative is just to try a completely different text editor altogether. And that is where CKEditor comes in. If you’re keen on getting away from TinyMCE altogether, this is your best option.This plugin also has very high ratings in the directory, and is being updated regularly. Some of the reliability issues with TinyMCE disappear when using CKEditor. But whilst it may not have the beating of TinyMCE on all fronts, it is competition like this that may force TinyMCE to up its game.4. Raw HTMLFinally, we have something for people who like to get down and dirty with code. Raw HTML is a plugin that assumes you are not an idiot. By that I mean it allows you to use HTML, CSS and JavaScript within WordPress without it getting mangled or removed. All you need to do is enclose your code with [raw][/raw] tags, and it will be ignored by WordPress.The plugin also places a widget within your New Post/Page screen which allows you to disable certain features:Please note that the full version of Raw HTML is a premium plugin that sells for $15.All Is Not LostWordPress may not have the greatest WYSIWYG editor around, and we may have been moaning about certain things for several releases of WordPress without anything being done about them, but there is a light at the end of the tunnel, as you can see from the above options.Creative Commons photos courtesy of Lili Vieira de Carvalho

text-editor

Read more »

How to Set the Default Editor to Visual or HTML in WordPress

Did you know that you can set the default editor in the WordPress post editor screen? I found this handy little filter over at wp-snippets.com. Select which on you want to be the default and simply add this to your theme’s functions.php file:

For Visual set as default:

1
add_filter( 'wp_default_editor', create_function('', 'return "tinymce";') );

For HTML set as default:

1
add_filter( 'wp_default_editor', create_function('', 'return "html";') );
editor

Read more »