How to make a custom widget area in wordpress?

custom widget area in wordpress custom widget area in wordpress WordPress Amitpal Singh First of all place this code in function.php file to register a widget. Make sure that this widget name is unique and different for each. [php] if (function_exists(‘register_sidebar’)) { register_sidebar(array( ‘name’ => ‘Extra Widgets’, ‘id’ => ‘extra-widgets’, ‘description’ => ‘The extra widgets […]

How to Add Page Slug in Body Class of your WordPress Theme ?

Page Slug in body class Page Slug in body class WordPress Amitpal Singh Put this in your theme functions.php [php] //Page Slug Body Class function add_slug_body_class( $classes ) { global $post; if ( isset( $post ) ) { $classes[] = $post->post_type . ‘-‘ . $post->post_name; } return $classes; } add_filter( ‘body_class’, ‘add_slug_body_class’ ); [/php] You […]

How to make scroll to top ?

Scroll to top Scroll to top WordPress Amitpal Singh 1, Place the javascript code inside head tag: [html] <script type="text/javascript"> $(document).ready(function(){ $(window).scroll(function(){ if ($(this).scrollTop() > 100) { $(‘.scrollup’).fadeIn(); } else { $(‘.scrollup’).fadeOut(); } }); $(‘.scrollup’).click(function(){ $("html, body").animate({ scrollTop: 0 }, 600); return false; }); }); </script> [/html] 2, Place the style code in css file: […]

Media upload default linking (change the attachment link to none in WordPress)

attachment link attachment link WordPress Amitpal Singh Blog This procedure will work for image media default linking in wordpress…… Place this in your theme’s functions.php file. [php] function mytheme_setup() { // Set default values for the upload media box update_option(‘image_default_align’, ‘center’ ); update_option(‘image_default_link_type’, ‘media’ ); update_option(‘image_default_size’, ‘large’ ); } add_action(‘after_setup_theme’, ‘mytheme_setup’); [/php] If you want […]

Bitnami