This here is the most recent article, but you can browse all other sections below.

Thursday, March 10, 2011

Current or Active Navigation Highlighting in new WordPress Nav Menu


I have fallen in absolute love with the WordPress 3.0x dynamic menu options. This has given WordPress another leverage in being the superior content management system.

I am currently working on a project using WordPress as the Content Management System.  One of the requirements for this project was utmost flexibility of the system. Making the navigation easy to customize by the client meant activating the new wp_nav_menu().  For function/API reference, you can check http://codex.wordpress.org/Function_Reference/wp_nav_menu

Not until I got my hand dirty in the WordPress theming process did I realize that there was no room for assigning active classes on the codes dynamically.  During my research I have come up with two solutions…at least till the WordPress team add support to this feature.

The first technique is to give your <body> an ID with the name of your current webpage, then using CSS to select the menu element.

Let me explain in ‘english’. Let’s say your is http://yourpage.com/about, you can give your <body> an ID of ‘about’. So it would look like this: <body id = “about”>

How would you do that dynamically?

In your header.php file, add this:

What this does eventually is removes everything from your URL save your ‘page name’. So http://yourwebsite.com/about.php will return ‘about’.

Next, in your CSS you can select the particular element:

 body#about ul#extra-nav li.history a{ our_css_property: xxxx; }

Basically, what this does  is it selects the anchor in the list item with a class called history under the ul with an ID of extra-nav that particularly belongs to the body tag called about. It then gives it property.

I got this idea from watching a CSS-tricks video. You may find it really explanatory.

Other Alternatives

There are actually many approaches to this. I guess it depends on your choice. I have also found these

 

 


Friday, January 07, 2011

Critical vulnerability identified in PHP; hotfix available


The Zend Company reported today: A critical vulnerability in the PHP engine has just been identified. This exploit is significant because most PHP applications on impacted systems are remotely exploitable to a very simple denial of service attack. Zend has released a security hotfix to address this vulnerability (see below).

Due to the way the PHP runtime handles internal conversion of floating point numbers, it is possible for a remote attacker to bring down a web application simply by adding a specific parameter to a query string in their web browser (click here for more information).

This vulnerability is present on all versions of PHP including PHP 4.x and 5.x, on all Intel-based 32-bit PHP builds.

Platform Vulnerability
Windows YES
Linux (using 32-bit PHP build) YES
Linux (using 64-bit PHP build) NO
Mac OS NO
IBM i NO

Zend Server and Zend Server CE users should immediately apply the security hotfix.

Hotfixes for Zend Core and Zend Server CE tarball installer are currently being finalized and will be made available soon.

Tags: ,

This article was written by Seye Kuyinu. I am a web applications developer with new interest in UX design. Lately, I have focused my attention from core web applications development to interface designs and development processes using User Experience principles. I am also an ardent fan of WordPress. I have a hang of the HTML, CSS, PHP, MySQL, ActionScript, JavaScript. In my spare time I play the violin. You can follow me on twitter: @seye


Article Browser