wpGeek

So I needed a function for which would check whether page has subpages/childrens or not. So I came up with this:

Just put this code in functions.php:
function post_have_children($id){
$children = get_pages('child_of='.$id);
if(count($children) == 0){
return false;
}
else{
return true;
}
}

Ussage:

<?php post_have_children('pageID'); ?>

pageID – the id of the page you want checked, can be used $post->ID which would be current page.

Note: check the quotes, because sometimes when doing copy paste they can be copied as symbols.

Furthermore, if you want to check if parent page has subpages/childrens or page has a parent as a conditional tag you can that by using it like this:

<?php if ( $post->post_parent != 0 || post_have_children($post->ID) ) {
// Show text if page has a parent or Page is a parent and have children/subpages
} ?>

Tags: , , ,

I started building a wordpress catalog plugin, where people can create store data & publish data on pages. I already have a beta version of this plugin which creates new tables in the database and stores information and publishes information, that visitors filled in the form.

Information can be published in any page created via wordpress admin panel. Furthermore information can be stored and modified via admin panel.

Email me if you would like to get the beta version.

Tags: ,

During my work as a wordpress theme coder I came across that there are request for a function on how to limit the post titles. So here you are the code and hope that it will be useful for you:

Open functions.php in your theme and copy/paste this code:

<?php function limit_title($title, $n){
if ( strlen ($title) > $n )
{
echo substr(the_title($before = ”, $after = ”, FALSE), 0, $n) . ‘…’;
}
else { the_title(); }
}
?>

Then just put this function where you want in your wordpress theme templates:

<?php limit_title($post->post_title, 30); ?>

Note:

  • Number in the gaps means to how much symbols you want to limit
  • The function should be used in the post loop

Tags: , , ,

SteveTenpenny.com

Client: SteveTenpenny.com
WordPress Theme Ordered: 2009-05-8
WordPress Theme Completed: 2009-05-15

This Website will help you to improve your sites traffic and earn more money from it.

Tags: , , ,

1

Theme Information

Brownie, 2-column WordPress theme with widget-ready sidebar, custom template, custom text styles and web 2 style. It’s compatible with WordPress 2.7 and has been tested with in Firefox, Google Chrome, Internet Explorer 7, Opera and Safari.

If you need any help inserting banners or anything else. Just drop me an email or comment here. I will try to answer to every question.

Tags: , , , ,