Habari PHP weblog software

Having a lot of work stacked up and nothing fun to do, I decided to ignore the work and give Habari a test installation on a localhost, just play around with it for an hour or two and see what the deal was with the core code.

To be scrupulously fair, these vague observations are the product of an hour or so, and of course, not authoritative in that regard. Against this, I have no great love for the present direction of WordPress… 2.5 seems laudable in most ideas, but not quite the finished version at present - there is still the spectre of bloat here, and I don’t think viable competition would do WordPress any harm at all.
read more »

WordPress PHP - Post duplicates in 2 loops

A quick and simple way to knock out duplicates if you have 2 Loops on the page

The first loop will look something like this:-
read more »

WordPress and Programming Tutorials

People (visitors) quite often enquire why there is a lack of detail in the various code snippets given as brief tutorials on this blog. And it’s true, often only the only relevant line of code is given.

Well, simple answer - I am a great believer in the principle:

If you have ask - you probably shouldn’t be doing…

read more »

Customized WordPress RSS Feed

Here’s a very simple hack to exclude items from an RSS feed, and since the principle involves the Loop, by extension, for post output as well - it’s not great programming style or practice but it does the job.

Exclude by author - any post you don’t want to appear on the RSS (maybe you’re a bit shy about sponsored posts…) assign to their own author.
read more »

Alternates - PHP test for Odd or Even

You want alternating backgrounds for posts down the page, or alternately styled table rows, or alternating anything - you need to test whether something is odd or even.

read more »

WordPress Database Operations

mysql.gifYou will need a little knowledge of PHP and MySQL to get the hang of this - but it is perhaps easier than it looks at first sight, and it’s also a good way of expanding your skills in this area…

You want to get some info from the database, and you want it more flexibly than built-in functions like, say, wp_list_pages - this is the general how-to …
read more »

WordPress child page menu

Here’s a nice and neat code snippet - making use of the template and conditional tags to output unordered list items for all child pages under the current page - with links - and just the thing to stick in a theme’s sidebar.

Best used in conjunction with is_page, of course, so…

<?php
if(is_page()){

$parent = ($post->post_parent == 0)? $post->ID : $post->post_parent;

wp_list_pages(’child_of=’.$parent.’&title_li=’);

}

?>

Wordpress Page Menu code

As requested, the code for page menu tabs - leaving open the possibility of using the ’sliding doors’ technique - put it in a theme’s functions.php, and the usage, if not too obvious, would be something like…

<ul id=”tabmenu”>

<?php echo buildMenu(); ?>

</ul>

read more »