-
-
Save gorobey/fe68f0a519083ac6d25941f785428aa9 to your computer and use it in GitHub Desktop.
Revisions
-
zgordon revised this gist
May 16, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ function custom_get_excerpt($post_id) { function custom_add_meta_description_tag() { ?> <meta name="description" content="<?php if ( is_single() || is_page() ) { $excerpt = custom_get_excerpt(get_the_ID()); echo $excerpt; } else { bloginfo('description'); -
zgordon revised this gist
May 16, 2015 . 1 changed file with 2 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,11 +10,8 @@ function custom_get_excerpt($post_id) { return $excerpt; } function custom_add_meta_description_tag() { ?> <meta name="description" content="<?php if ( is_single() || is_page() ) { $excerpt = custom_get_excerpt(get_the_ID()); @@ -25,4 +22,4 @@ function add_meta_description_tag() { ?>" /> <?php } add_action('wp_head', 'custom_add_meta_description_tag', 1); -
zgordon created this gist
May 16, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ function custom_get_excerpt($post_id) { $temp = $post; $post = get_post( $post_id ); setup_postdata( $post ); $excerpt = esc_attr(strip_tags(get_the_excerpt())); wp_reset_postdata(); $post = $temp; return $excerpt; } function sbt_auto_excerpt_more( $more ) { return ''; } function add_meta_description_tag() { ?> <meta name="description" content="<?php if ( is_single() || is_page() ) { $excerpt = custom_get_excerpt(get_the_ID()); echo $excerpt; } else { bloginfo('description'); } ?>" /> <?php } add_action('wp_head', 'add_meta_description_tag', 1);