blue

blue by Ehsanul Haque
blue, a photo by Ehsanul Haque on Flickr.

Posted in Fun, Interest, Photography, Playground | Tagged , , | Leave a comment

spring is here

spring is here by Ehsanul Haque
spring is here, a photo by Ehsanul Haque on Flickr.
Posted in Featured, Fun, Interest, Photography, Playground | Tagged , , , | Leave a comment

BijoyDibosh Smilies

I am trying to make a set of smilies to celebrate our Victory Day (িবজয় িদবস). Here is the sample :)

The bigger version

BijoyDibosh Smilies

Posted in Bangladesh, Featured, Fun, Interest, Playground | Tagged , , , , , , , , , | 8 Comments

WordPress wp_nav_menu to Exclude Page(s)

While working on a project I realised that I need to exclude pages I created from the top menu, which is built by wp_nav_menu function in header.php. I could use Menus under Appearance tab to define a top menu and pass the menu name in the function arguments but I would loose the CSS for the original menu created by wp_nav_menu itself. So I started looking for ways to exclude the pages I don’t want to show on the top menu. So I kind of added a hack in wp_nav_menu function.

First, I added “exclude” in the list of default arguments:

$defaults = array( 'menu' => '', 'container' => 'div', 'container_class' => '', 'container_id' => '', 'menu_class' => 'menu', 'menu_id' => '', 'echo' => true, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'depth' => 0, 'walker' => '', 'theme_location' => '', 'exclude' => '' );

Then I copied couple of lines from wp_list_pages function (in post-template.php) to add the $exclude_array variable:

$exclude_array = ( $args->exclude ) ? explode(',', $args->exclude) : array();
$args->exclude = implode( ',', apply_filters('wp_nav_menu_excludes', $exclude_array) );

Note that I had the change $args['exclude'] to $args->exclude. Now in header.php just add the exclude in the argument array:

< ?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary', 'exclude' => '66' ) ); ?>

Done! The unwanted pages are gone from the top menu. Booyaaah!

Posted in Codes, Fun, Interest, Resources, Tips and Tricks, WordPress | Tagged , , , , , | 13 Comments

Grab Yahoo class revived

Finally after months of waiting I’ve updated Grab Yahoo class on PHPClasses.org and PHPKode.com.

Thanks to Ovidiu who fixed the latest problem. I’ve tested it and is working as expected. The demo is running http://resource.bdwebwork.com/GrabYahoo/ and latest code can either be downloaded from PHPClasses.org or PHPKode.com.

Thanks :-)

Posted in Codes, Interest, Linux, PHP, Resources, Tips and Tricks | Tagged , , , , , , , , , , | 1 Comment