rss
twitter
  •  

Count Number Of Posts Per Category In Wordpress Theme

| Posted in Interesting |

View Comments

After searching for days, to no avail, for a Wordpress plugin or hack to count the number of posts in a specific category I finally came up with a little coding of my own that should work in any Wordpress theme.

Copy/Paste the following code snippet into your theme’s functions.php file:(without the quotes)

function number_postpercat($idcat) { global $wpdb; $query = “SELECT count FROM $wpdb->term_taxonomy WHERE term_id = $idcat”; $num = $wpdb->get_col($query); echo $num[0]; }

You can edit the functions.php file by going to Appearance>>Editor in your Wordpress back-office.

You can then call the function by adding the following code snippet into your theme wherever you need to do the count:(without the quotes)

<?php number_postpercat (4); ?>

The result will be something like: Wordpress Themes(19) | Wordpress Plugins(21) etc.

The sample number “(4)” above is the Wordpress category ID.

I hope that this will save someone else some valuable time.

Your email:

 

Backup-Synchronisation Of Contacts Amongst Different Devices

| Posted in Interesting |

View Comments

Over the years I have looked at many solutions of synchronisation and backup of my contacts and calendars using all kinds of software and online tools. This caused a lot of duplicate content and even lost content.

I am not a firm believer of installing all kinds of fancy software on my computer so I ended up figuring out a way of setting up the whole lot manually and even somewhat automatically. That way I know that I am in control and not some fancy software or online solution.

For this illustration I am using Mozilla Thunderbird, Gmail and my Nokia E63. The basic procedure is very much the same in MS Outlook and on other brands of cellphones.

My procedure is as follows:

In Thunderbird go to Tools–>Address Book.







Once the address book is open, select the address book that you want to export. Select Tools–>Export and you will be represented with a new window asking you where you want to save the file and in which format. Usually it’s the easiest to export it to your desktop. Select to export the file in Comma Separated Value (CSV) and save the file.







Now open Gmail and select “Contacts” from the left menu.












Once the contacts page is open choose “Import” on the top right of the page.








You will now be presented with a page where you can click on the “choose file” button. Once you have clicked on this button, Windows Explorer will open. In Windows Explorer, navigate to your desktop folder and find the CSV file that you have saved earlier and select and open it. You can now click the import button on your Gmail page. Once the import has been done, Gmail will report the amount of contacts that has been imported and you can click on OK to see a list of the imported contacts.







You now have a permanent backup copy of all your contacts in your Gmail account in case of a computer crash. In case of the latter, you can always go back to your Gmail “contacts” folder and export your list of contacts and import them back into your desktop email application. It is also important to note that you have to perform the above procedure from time to time to keep your Gmail address book updated.

Next step is to synchronise your Gmail Contacts and Google Calendar with your cellphone. I always save all my appointments on my Google Calendar seeing that you can setup Google Calendar to notify you of your appointments by Email, SMS or both. In the case of my specific phone (Nokia E63) I had to install “Nokia Mail For Exchange”, a free application. Google support instructions for the various phones are available here.

Once you have setup your cellphone, it will synchronize your calendar and your contacts on (in my case) a daily basis, automatically.

For me this process of synchronisation and backup works perfectly, being a person not liking too many third-party applications on my computer or cellphone. This process is seamless and streamlined and, best of all, it’s free! At the end of the day this process involves about 5% of manual work and 95% of automation. To me that is close enough to a 100% seeing that it doesn’t cost me a cent and it works well.

Please feel free to contribute and share about how you prefer handling this process.

Your email:

 

Windows 7 GodMode Unleashes Advanced Features

| Posted in Interesting |

View Comments

Windows 7 has a hidden feature called GodMode that reveals just about any secret little tweak that one could do in Windows 7 without the need of installing any fancy software.

To enable GodMode in Windows 7, right-click on the desktop and select “Create New Folder”. Name this folder “GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}” and voila, there you have access to tons of Windows 7 tweaks!

Enjoy!!!

Your email: