Plugin Directory

Changeset 401961


Ignore:
Timestamp:
06/28/2011 05:38:54 AM (15 years ago)
Author:
nemooon
Message:

fixed og:description

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mixi-check/tags/1.1/sharing-sources.php

    r401951 r401961  
    6060                the_post();
    6161                $post = get_post( get_the_ID() );
     62                if ( has_excerpt() ) {
     63                    $description = strip_tags( $post->post_excerpt );
     64                } else {
     65                    $description = strip_tags( strip_shortcodes( str_replace( array("\n","\r","\t"), '', $post->post_content ) ) );
     66                    $description = mb_substr( $description, 0 , 100 );
     67                }
    6268                echo '<meta property="'.$ns.':title" content="' . $post->post_title . '" />'.PHP_EOL;
    63                 echo '<meta property="'.$ns.':description" content="' . $post->post_excerpt . '" />'.PHP_EOL;
     69                echo '<meta property="'.$ns.':description" content="' . $description . '" />'.PHP_EOL;
    6470                echo '<meta property="'.$ns.':type" content="article" />'.PHP_EOL;
    6571                echo '<meta property="'.$ns.':url" content="' . get_permalink() . '" />'.PHP_EOL;
Note: See TracChangeset for help on using the changeset viewer.