Archive for the ‘WordPress’ Category

Getting options from the database without a Loop

Monday, May 25th, 2009

If you’re ever in need of getting options, whether it’s those on the WordPress Dashboard or ones you’ve created by yourself, WordPress has a very easy, very simple built in function. get_option() gets any option in the database. Say you need to grab the posts to display per page (in the Settings>Reading admin page), you simply put:

<?php echo get_option('posts_per_page'); ?>

.

Handy tip for the day!

is_tree – the function WordPress is missing (one of the many)

Monday, May 11th, 2009

So for a current project I am using pages to create a bi-lingual site. I needed to check which menu to display, as it depended upon what the top level page was- english or french. I searched a bit, and found that there was no is_subpage or is_tree function, so I set out to make my own. How I did it, after the break! (more…)

How to fix broken pagination when using query_posts

Wednesday, May 6th, 2009

Just a quick tip for today- fixing pagination when using query_posts. The scenario. You’re using WordPress for your entire site, and hav a portfolio page and a testimonials page that both use posts to fill them. That’s all and good, however you’re excluding them from your Blog page using query_posts to modify what comes out of your Loop. You’ve got it working, but when you troubleshoot, you can’t go back a page! Oh no! You Google around and find this page… (more…)