How to override the comments form in a child theme

This is a quick post on how to provide your own comments template in your child theme ( overriding comments.php in your parent theme). You can just as easily use the same code to override comments.php if you aren’t using a child theme. Todo this you need to you need to use the filter ‘comments_template’ … Read more

How to engage your staff using your Intranet

In this article, we’ll look at some ideas for useful things to have on your intranet and how to use these to help engage your Employees, members or Volunteers. What are the benefits of engaged staff ? Happy workforce ( productive workforce, helps business be more profitable) Low Staff turnover ( saves money in recruitment … Read more

Buddypress how to remove tabs from groups sub tabs ( eg remove Delete group)

This code is based on a post from the buddypress forums tested on Buddypress 2.9.2  ( forum states its compatible from BP 2.6+). In this example we remove the Delete tab and also permission so that user can’t try and goto the url to access it. Note there are numerous other examples / versions of … Read more

WordPress SQL snippets

A place to keep snippets of useful WordPress SQL. Do a select based on some meta field of a post ( i.e. search for a post that has a particular metafield  ) SELECT p.ID,p.post_title, MAX(CASE WHEN pm1.meta_key = ‘id_vim_node’ then pm1.meta_value ELSE NULL END) as field_i_want FROM wp_posts p LEFT JOIN wp_postmeta pm1 ON ( … Read more

How to get a users Roles and how to list all WordPress roles in PHP

This code is handy if you want to find out a users role/s. You could expand it and check if a user has a given role or similar. $user_info = get_userdata(2152); echo ‘Username: ‘ . $user_info->user_login . “\n”; echo ‘User roles: ‘ . implode(‘, ‘, $user_info->roles) . “\n”; echo ‘User ID: ‘ . $user_info->ID . … Read more