Import the database using the CMD prompt on Windows

Step 1: Go to Run Command [Win+R] and type CMD and click on OK to open CMD prompt Step 2: Navigate to following folder path “wamp\bin\mysql\mysql5.5.24\bin” using command line [ex: cd D:\wamp\bin\mysql\mysql5.5.24\bin] Step 3: Type this mysql -u username -p -h localhost DATA-BASE-NAME < data.sql with your updated data on command prompt Step 4: Finally click on the...

Read More
Make the “read more” link to the post
Dec03

Make the “read more” link to the post

Place this in a theme’s functions.php to make the “read more” link to the post function new_excerpt_more( $more ) { return ' <a class="read-more" href="'. get_permalink( get_the_ID() ) . '">Read More</a>'; } add_filter( 'excerpt_more', 'new_excerpt_more' );

Read More
Remove […] string using Filters
Dec03

Remove […] string using Filters

In WordPress version 2.9, a new filter was added to make changing the […] string in the excerpt. Do not use both of these methods in the same WordPress installation. Use the one appropriate for your WordPress version. For versions 2.9 and higher of WordPress By default, excerpt more string at the end is set to ‘[…]’. To change excerpt more string using excerpt_more filter, add the following code to functions.php file in your theme: function new_excerpt_more( $more ) { return '[.....]'; } add_filter('excerpt_more', 'new_excerpt_more'); For versions 2.8.x and Older function new_excerpt_more( $excerpt ) { return str_replace( '[...]', '...', $excerpt ); } add_filter( 'wp_trim_excerpt', 'new_excerpt_more'...

Read More
Control Excerpt Length using Filters
Dec03

Control Excerpt Length using Filters

By default, excerpt length is set to 55 words. To change excerpt length to 20 words using excerpt_length filter, add the following code to functions.php file in your theme: function custom_excerpt_length( $length ) { return 20; } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

Read More
Shortcode for display the WordPress theme path using php function
Sep18

Shortcode for display the WordPress theme path using php function

Shortcodes are easy and useful for wordpress. Shortcodes helps in so many things like we can use one instead of retyping a lot of content. In web developing time we can minimize the lot of time. I use this often when developing themes for clients so that when I put an image inside the themes image folder during development, when the theme is later placed on the client’s server, the image path still works without me having to change it. Just add following Code to the functions.php file in your current WordPress theme. /* * Get stylesheet directory for images */ function themepath_shortcode() { return get_bloginfo('stylesheet_directory'); } add_shortcode('theme_path', 'themepath_shortcode'); Now you can just type [theme_path] shortcode in wordpress editor. Place this shortcode inside an image src or other places as...

Read More
How to place the content for only Homepage in Magento
Aug01

How to place the content for only Homepage in Magento

How to place the content for only Homepage in Magento? Following code is useful to place the content in only homepage not in other pages. <?php if ($this->getIsHomePage()):?> Homepage content goes here... <?php else:?> Other pages content except Homepage goes here... <?php endif?>

Read More
'