How to use Twentyten theme as custom theme!
Twenty-Ten, a default theme for wordpress, is really a simple and good theme. It mostly happens that you need to make changes in default Twentyten theme LIKE Change the width of the sidebar, change the menu text spacing etc. When that kind of changes are required, what most of developers …
wp_nav_menu First and Last Classes
wp_nav_menu allows you to show navigation in the front-end. This simple function picks the menu defined in the wp-admin dashboard and displays it as the list. You can define menu separator using “link_before, link_after” or “before, after” params. But the common problem with this function is that sometimes we need …
Remove Parent Categories from URL
How to remove the parent category from the url with WordPress 3.1? One way is, Just paste the below one code in your functions.php : add_action( ‘init’, ‘build_taxonomies’, 0 ); function build_taxonomies() { register_taxonomy( ‘category’, ‘post’, array( ‘hierarchical’ => true, ‘update_count_callback’ => ‘_update_post_term_count’, ‘query_var’ => ‘category_name’, ‘rewrite’ => did_action( ‘init’ …
Auto Login to wordpress
Sometimes, in wordpress, what we need is to make a user auto log in. Solution for this is very simple. Just put the following code in your functions.php :- function auto_log_me_in($user_login) { $user = get_userdatabylogin($user_login); $user_id = $user->ID; wp_set_current_user($user_id, $user_login); wp_set_auth_cookie($user_id); do_action(‘wp_login’, $user_login); } Now call auto_log_me_in($user_login); where you want …
After submit form get “Page Not Found”
Sometimes, using wordpress, when one submits a form, it shows “Page not found” but the page exists. To avoid this, just do following steps: – Just check your form for the field with the name equal to “name”. eg: <input type=”text” name=”name” /> – Replace its name with some else …
