Some WordPress Code Snipss

    1. By Default WordPress displays the excerpt of the current post with the “[…]” text at the end, which is not a “read more” link. So to have a custom excerpt add following to the function.php

function new_excerpt_more($more) {
global $post;
return ‘<p><a href=”‘ . get_permalink($post->ID) . ‘”> Continue Reading</a></p>';
add_filter(‘excerpt_more’, ‘new_excerpt_more’);

    1. To Enable Featured Image


    1. To set a custom length of Excerpt

function custom_excerpt_length( $length ) { return 200; } add_filter( ‘excerpt_length’, ‘custom_excerpt_length’, 999 );