Skip to content

Commit

Permalink
Site Icon will be shown if the article doesn't have post thumbnail. #3
Browse files Browse the repository at this point in the history
  • Loading branch information
mayukojpn committed Nov 29, 2015
1 parent 622ae32 commit 324a370
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions css/mamahack.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@
vertical-align: middle;
padding-right: 15px;
}
.p-entry__tw-follow__cont > * {
margin: 0;
}
13 changes: 11 additions & 2 deletions mamahack.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,19 @@ public function the_content( $contents )
}
$like = '<div style="padding:10px 0px;"></div>';

if (get_option('mamahack_fb_account'))
if ( get_option( 'mamahack_fb_account' ) )
{
$like .= '<div class="p-entry__push">';
$like .= '<div class="p-entry__pushThumb" style="background-image: url(' . wp_get_attachment_url( get_post_thumbnail_id($post->ID) ). ')"></div>';
$like .= '<div class="p-entry__pushThumb" style="background-image: url(';
if ( has_post_thumbnail( $post->ID ) )
{
$like .= wp_get_attachment_image_url( get_post_thumbnail_id($post->ID), 'medium' );
}
elseif ( has_site_icon() )
{
$like .= get_site_icon_url();
}
$like .= ')"></div>';
$like .= '<div class="p-entry__pushLike">';
$like .= '<p>'._('この記事が気に入ったら<br>いいね!しよう').'</p>';
$like .= '<div class="p-entry__pushButton">';
Expand Down

0 comments on commit 324a370

Please sign in to comment.