Skip to content

Commit

Permalink
剪斷標題符合 OG,OG 採用自訂摘要
Browse files Browse the repository at this point in the history
  • Loading branch information
YamiOdymel committed Jan 18, 2020
1 parent 55c2b02 commit 876df91
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions header.php
Expand Up @@ -7,10 +7,9 @@
<?php if ( get_theme_mod( 'social_friendly', 'enabled' ) == 'enabled' ) {
global $post;
global $wp;

$type = is_singular() ? 'object' : 'website';
$title = is_singular() ? get_the_title() : get_bloginfo( 'name' );
$description = is_singular() && $post->post_password == '' ? wp_trim_words( $post->post_content, 180 ) : get_bloginfo( 'description' );
$title = is_singular() ? wp_trim_words(get_the_title(), 30, '…' ) : get_bloginfo( 'name' );
$description = is_singular() && $post->post_password == '' ? wp_trim_words( has_excerpt() ? get_the_excerpt() : $post->post_content , 180 ) : get_bloginfo( 'description' );
$url = is_singular() ? get_the_permalink() : home_url( $wp->request );
$site_name = get_bloginfo( 'name' );
$images = array();
Expand Down

0 comments on commit 876df91

Please sign in to comment.