51

Enhancing your WordPress 3 menus

WordPress 3 comes with integrated menu management. Although still a bit quirky at times, it makes creating and managing (navigation) menus a breeze. However, now that creating and displaying a menu takes nothing more than one line of code (wp_nav_menu), we appear to have lost the ability to “manually” add our own stuff.

For instance, by design, there is no “home” link on any menu. Though it is easy to create a custom menu item in the menu management, there is an easier way, using WordPress filters.

The navigation menu can be “filtered”, and so can the navigation menu items. This allows us to add menu items at will.

Inspired by a support request, I did a bit of digging, the result are the following three code snippets, that you can add to your themes functions.php file and will add a login/logout link, add a search field or a Home Page link to your WordPress 3 navigation menu.

Read More→

Since WordPress version 2.9, featured images (formerly known as “post thumbnails”) are integrated in the Write Post and Write Page panel. Not all WordPress themes make use of these fields, and a change to your template files is required.

In this post I will explain how you can add Featured Images to your posts and pages with only a modification to your functions.php file, and some basic styling using css. This is in particular useful when you have multiple Page templates, and therefore need to update several files to incorporate the featured images in each page.

More after the break.

Read More→

The idea for this came from a request, where the customer wanted to allow users to register online, and then allow these users to be able to view a list of all other users that have registered. Regular site members, such as subscribers, editors, authors or contributors however should NOT be included, and neither should these (standard WordPress roles) have access to the page that lists these “special” users.

It is complicated to list users by Role in WordPress. There is no API or function in WordPress to create a subset of users based on their role. All (or most) examples I could find was to use the user-level assigned to each Role, but since that is deprecated since WordPress 2.0, I didn’t want to use that.

Rather than coding the entire functionality, I tried to use as much of the available tools, plugins and WordPress functions available. The solution I came up with consists of 2 plugins, a bit of configuring, and a bit of coding. All tied together it makes a nice way to implement additional CMS functionality in WordPress, without using a full membership plugin.

Note, this is not a “download and run” solution, but if you follow the steps, it will work, and hopefully will also give you an idea of what can be achieved with WordPress using plugins, a bit of code and your imagination.

Read More→

My First DokuWiki Plugin

Well who would have thought I’d start writing DokuWiki plugins for a change. It’s a bit of a workaround plugin, due to an issue in a WordPress – DokuWiki login bridge that I’ve implemented. All wiki content was being escaped (addslashes), so that “you’re” became “you\’re”. I have yet to find a real solution for this, whether it is the bridge, or dokuwiki, but for the time being, I can move on without polluting the wiki pages by using this plugin:

Read More→
Categories: Code Snippets

Tags:

As requested in this post on the iThemes support forum, here are the instructions to create a page template for the iCompany Theme series by iThemes (these instructions will most likely work for iCar and iRealEstate as well). This template will not have the grey bar and the featured area, and the main content will expand to the right until the right tabber sidebar.

Read More→

Here are the instructions to create a landing page without sidebar and (optionally) the footer blocks (about and navigation) for iThemes‘ bSocial theme.

Read More→