How to Enable mod_rewrite In Windows

Many times developers face to a problem when they change the permalinks settings. Suddenly their links look broken. You can try by enabling mod_rewrite in Apache server in windows. Here what we do….

1.open “httpd.conf” file.
2. Find “mod_rewrite.so” in the file. (you can simply user Ctrl+F).
3. remove the “#” to uncomment.
4. Restart apache service.

You are done….

Advertisements

How to add a menu to your wordpress page

First create your menu at Dashboard -> Appearance ->Menus -> . As an example i want to create a menu named “topmenu1”.

Add the required pages, categories or links to the menu .

Add theis code block to the place where you want the menu to be appeard.

<?php wp_nav_menu(array('menu'=>'topmenu1','container_class' => 'menu-header')); ?>

you can find more details about wp_nav_menu funtion and its parameters here.

How to get a comma separated list of values In SQL 2008

Once I had to retrieve a comma separated list of a user names in the users table of the system. after searching the internet for a moment I came across with this wonderful technique to achieve it with COALESCE . This function is available in SQL 2008.

DECLARE @strUserNames VARCHAR(MAX)
SET @strUserNames='””

SELECT @strUserNames=COALESCE (@strUserNames+’,’,”)+ UserName
FROM Users

select (@strUserNames)

“UserName ” is the column of  “Users” table where we store user names of the users…enjoy…:)))