Blogging software: WordPress

From Elvanör's Technical Wiki
Jump to navigation Jump to search

Configuration

  • The encoding of your blog van be set in Settings -> Reading. Of course utf-8 is recommended. This is saved in a blog_charset option in the wp_options database table.

Creating a new Article

  • Don't copy via Firefox the contents of an old post; this results in a broken layout. The best way is to edit the old post you want to copy, and copy its HTML code directly.

Widgets

  • Widgets are the equivalents of modules in Joomla: small snippets of HTML that you can stick in your WP page at various placeholders.
  • To manage widgets go to: Appearance -> Widgets.

Plugin Development

  • Although WordPress is great, the plugin development framework is totally broken. It is possible to do whatever you need to do, but the code is 100% ugly and there is no real way of getting your stuff done in a beautiful way. This is just spaghetti PHP code as its worst, a tons of stuff hacked together without any general visions.

General remarks

  • If you use register_setting to update some plugin options on the back office, be very careful. All options get updated all the time even if you did not specify a form field for them, and validation is basically nowhere (the sanitize_callback thing is a joke: there's no documentation about it, so no way of knowing how it works).

Options

  • Use update_option if you want the option updated regardless of the existence of a previous value; use add_option if you only want to change the option if it does not exist before.