Category: WordPress Hacks

  • Sort Posts With The Help Of Custom Fields

    Quite often, a WordPress developer likes to have posts sorted according to a custom field. If you would write a SQL-statement, it would be quite complex, since you need to JOIN two database tables (wp_posts und wp_postmeta). But there is a much easier way, if you use the template tags provided by WordPress – in…

  • Extend the User Contact Info in WordPress 2.9

    Joost de Valk wrote about a month ago a really great article about his idea, to expand the user contact fields (thanks Joost!). In version 2.9 you are able to use this possibility. Here a little example, how you can use this functionality.

  • Display Private Posts to Logged in Users

    Sometimes I use the function of private posting in WordPress. These contributions can only see the user who has created the post, or the administrator. To show all these article to users who are logged into the system, you can go different ways. But I’d like to highlight just two different ways. With custom fields…

  • Update RSS Language Value

    And today opens the 13th door of our Advent Calendar. You cannot only use a language key for your blog, but also for your feed:<language>en</language>. WordPress also has provided an option, but not easy to maintain. However, it is advisable to use the key according to the codec and therefore I show you some ways.

  • If Post is Older Than

    12th door of our Advent Calendar, we are half through! Sometimes you need a query that satisfies the requirement that the advertising is displayed only if the article has reached a certain age. Who does not want to rely on a Plugin, we recommend the following little solution.

  • Change Wording for Password Page

    If you create a password protected page in WordPress, you have the standard sentence: “My post is password protected. Please ask me for a password:”. To change this sentence without losing the changes after the next upgrade, just place into the functions.php of your theme the following code: