Category Archives: PHP
Preventing RewriteBase - Deploy websites and apps on different locations
So I found a topic on stackexchange (for which unfortunately I can not find the link anymore) that had a question if it was possible to set up RewriteRules for sites in subdirectories. I found this to be an interesting topic, since I deal a lot with those kind of sites.
Continue reading “Preventing RewriteBase - Deploy websites and apps on different locations” »
wp_page_menu forward compatibility with wp_nav_menu
You’ve styled your wordpress menu’s like the following:
#site-navigation li.menu-item-has-children { position: relative; } #site-navigation ul.sub-menu { position: absolute; min-width: 100%; top: 100%; left: 0; } /* etcetera etcetera */
However, when you’ve not set a menu for your menu locations, dropdowns no longer work, current menu items are no longer styled, etcetera, etcetera. How do we fix it?
Continue reading “wp_page_menu forward compatibility with wp_nav_menu” »
WordPress gravatar / avatar bug: comment email instead of admin email
The following can happen:
- You make a site for a customer
- You insert some comments that your customer provides.
- Gravatar uses the admin email instead of the comment author email.
How do you get a gravatar image for the comment email instead of the author email?
You need to write a filter function. the get_avatar
filter passes the img code as first param, and the id of the author(you) or an emailaddress as the second.
Continue reading “WordPress gravatar / avatar bug: comment email instead of admin email” »
PHP Reverse Proxy
Just found this awesome proxy script: http://code.google.com/p/php5rp/ This is ideal for masking websites or storing your data on a different domain and faking the address. Yes, you can use a symlink, but this is a little safer.
A simple but smart dump(debugging) function using var_dump and func_get_args()
Every php developer knows the drill. Dumping debug info while developing. You either love it or you hate it. There are several solutions. In this post I will discuss those and suggest a lightweight alternative.
Continue reading “A simple but smart dump(debugging) function using var_dump and func_get_args()” »