Get current/clicked nav_menu_item-id in WordPress

The snippets story I needed to retrieve the nav-menu-item connected to the currently requested page/post in WordPress. I found some solutions going through the hole menu-tree, comparing each items object-id with the current post-id. But, since menu items are post-types, you are able to use all the WP-Query-params, even a meta-query. The code above selects [...]

Read more Tweet me Plus me

WordPress Post-to-Post relations, without altering the Database – The underestimated wp_postmeta Table

Using WordPress as a framework, particularly post-to-post relations demand some creativity sometimes. This article wants to explore possible ways of building post2post connections without altering the standard database scheme. But, be warned, it is not about best practices, performance or perfect database modelling. Its more an attempt to list all options to consider, before adding custom tables and queries and working around all the secure and tested WordPress API functions.

Read more Tweet me Plus me

Howto use array_map functionality on an associative array to change values *and* keys

First snippet for my collection.

Read more Tweet me Plus me

WordPress as a Framework for Web Apps – Building a simple Recipe Database

In the past Wordpress has grown from a powerful blog-system to a powerful CMS and, more recently, to a powerful framework for web applications. I found WordPress extremely useful as base for medium sized web apps, without too much traffic. This tutorial will show you how to customize WordPress to adjust it to your data model, mainly by showing you how to use the essentials to build every WordPress powered web app – Custom post types, Custom taxonomies and Custom fields.

Read more Code on github Tweet me Plus me

Get rid of WP E-commerce Scripts and Styles

Some weeks ago I had to implement a shop with WP-Ecommerce. The admin interface happens to be quite good and simple, but I wanted to build my theme from scratch, controlling the code to a 100%. So all the javascript and css stuff, that automatically gets included, was just a lot of overhead for me. It [...]

Read more Tweet me Plus me