Skip to content

Instantly share code, notes, and snippets.

@sunilw
Created April 10, 2014 04:54
Show Gist options
  • Save sunilw/10343616 to your computer and use it in GitHub Desktop.
Save sunilw/10343616 to your computer and use it in GitHub Desktop.
<?php
function get_ID_by_page_name($page_name) {
global $wpdb;
$page_name_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = '".$page_name."' AND post_type = 'page'");
return $page_name_id;
}
function custom_excerpt_length( $length ) {
return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
function new_excerpt_more( $more ) {
return '...';
}
add_filter('excerpt_more', 'new_excerpt_more');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment