Skip to content

Commit

Permalink
attachment page support
Browse files Browse the repository at this point in the history
  • Loading branch information
h2y committed Sep 21, 2016
1 parent 00c2102 commit b6916d9
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 43 deletions.
48 changes: 48 additions & 0 deletions attachment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
get_header('full-width');
?>

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

<article <?php post_class('box full-width page'); ?>>
<header class="entry-header detail-page">
<h2 class="entry-name">
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
</h2>
<ul class="entry-meta">
<li class="time_meta"><i class="fa fa-clock-o"></i> <?php the_time('Y-m-d H:i');?></li>
</ul>
</header>
<div class="entry-content" itemprop="description">
<?php the_attachment_link( $post->ID, true ); ?>
<?php the_content(); ?>
</div>
<footer class="entry-footer clearfix">
<div class="post-share">
<a href="javascript:;"><i class="fa fa-share-alt"></i><?php _e('share', 'quench');?></a>
<ul>
<li><a href="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>" target="_blank"><i class="fa fa-qq"></i></a></li>
<li><a href="http://service.weibo.com/share/share.php?title=<?php the_title(); ?>&url=<?php the_permalink(); ?>" target="_blank"><i class="fa fa-weibo"></i></a></li>
<li><a href="http://share.renren.com/share/buttonshare?link=<?php the_permalink(); ?>&title=<?php the_title(); ?>" target="_blank"><i class="fa fa-renren"></i></a></li>
<li><a href="http://twitter.com/share?url=<?php the_permalink(); ?>&text=<?php the_title(); ?>" target="_blank"><i class="fa fa-twitter"></i></a></li>
</ul>
</div>
<?php if( dopt('d_ding_b') != '' ) : ?>
<div class="post-love">
<a href="javascript:;" data-action="ding" data-id="<?php the_ID(); ?>" class="favorite post-love-link <?php if(isset($_COOKIE['mzw_ding_'.$post->ID])) echo ' done';?>" title="点个赞"><i class="fa fa-heart-o"></i>
<span class="love-count">
<?php
$ding_num = get_post_meta($post->ID,'mzw_ding',true);
echo $ding_num? $ding_num : '0';
?>
</span></a>
</div>
<?php endif; ?>
</footer>
</article>

<?php endwhile; endif;?>
</div></div>

<?php get_sidebar(); ?>
<?php get_footer(); ?>
8 changes: 3 additions & 5 deletions inc/post-format/content-gallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@
<a href="javascript:;" data-action="ding" data-id="<?php the_ID(); ?>" class="favorite post-love-link <?php if(isset($_COOKIE['mzw_ding_'.$post->ID])) echo ' done';?>" title="点个赞"><i class="fa fa-heart-o"></i>
<span class="love-count">
<?php
if( get_post_meta($post->ID,'mzw_ding',true) )
echo get_post_meta($post->ID,'mzw_ding',true);
else
echo '0';
?>
$ding_num = get_post_meta($post->ID,'mzw_ding',true);
echo $ding_num? $ding_num : '0';
?>
</span></a>
</div>
<?php endif; ?>
Expand Down
8 changes: 3 additions & 5 deletions inc/post-format/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,9 @@
<a href="javascript:;" data-action="ding" data-id="<?php the_ID(); ?>" class="favorite post-love-link <?php if(isset($_COOKIE['mzw_ding_'.$post->ID])) echo ' done';?>" title="点个赞"><i class="fa fa-heart-o"></i>
<span class="love-count">
<?php
if( get_post_meta($post->ID,'mzw_ding',true) )
echo get_post_meta($post->ID,'mzw_ding',true);
else
echo '0';
?>
$ding_num = get_post_meta($post->ID,'mzw_ding',true);
echo $ding_num? $ding_num : '0';
?>
</span></a>
</div>
<?php endif; ?>
Expand Down
8 changes: 3 additions & 5 deletions inc/post-format/single-gallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,9 @@
<a href="javascript:;" data-action="ding" data-id="<?php the_ID(); ?>" class="favorite post-love-link <?php if(isset($_COOKIE['mzw_ding_'.$post->ID])) echo ' done';?>" title="点个赞"><i class="fa fa-heart-o"></i>
<span class="love-count">
<?php
if( get_post_meta($post->ID,'mzw_ding',true) )
echo get_post_meta($post->ID,'mzw_ding',true);
else
echo '0';
?>
$ding_num = get_post_meta($post->ID,'mzw_ding',true);
echo $ding_num? $ding_num : '0';
?>
</span></a>
</div>
<?php endif; ?>
Expand Down
8 changes: 3 additions & 5 deletions inc/post-format/single.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@
<a href="javascript:;" data-action="ding" data-id="<?php the_ID(); ?>" class="favorite post-love-link <?php if(isset($_COOKIE['mzw_ding_'.$post->ID])) echo ' done';?>" title="点个赞"><i class="fa fa-heart-o"></i>
<span class="love-count">
<?php
if( get_post_meta($post->ID,'mzw_ding',true) )
echo get_post_meta($post->ID,'mzw_ding',true);
else
echo '0';
?>
$ding_num = get_post_meta($post->ID,'mzw_ding',true);
echo $ding_num? $ding_num : '0';
?>
</span></a>
</div>
<?php endif; ?>
Expand Down
6 changes: 2 additions & 4 deletions page-archives.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,8 @@
<a href="javascript:;" data-action="ding" data-id="<?php the_ID(); ?>" class="favorite post-love-link <?php if(isset($_COOKIE['mzw_ding_'.$post->ID])) echo ' done';?>" title="点个赞"><i class="fa fa-heart-o"></i>
<span class="love-count">
<?php
if( get_post_meta($post->ID,'mzw_ding',true) )
echo get_post_meta($post->ID,'mzw_ding',true);
else
echo '0';
$ding_num = get_post_meta($post->ID,'mzw_ding',true);
echo $ding_num? $ding_num : '0';
?>
</span></a>
</div>
Expand Down
8 changes: 3 additions & 5 deletions page-full-width.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@
<a href="javascript:;" data-action="ding" data-id="<?php the_ID(); ?>" class="favorite post-love-link <?php if(isset($_COOKIE['mzw_ding_'.$post->ID])) echo ' done';?>" title="点个赞"><i class="fa fa-heart-o"></i>
<span class="love-count">
<?php
if( get_post_meta($post->ID,'mzw_ding',true) )
echo get_post_meta($post->ID,'mzw_ding',true);
else
echo '0';
?>
$ding_num = get_post_meta($post->ID,'mzw_ding',true);
echo $ding_num? $ding_num : '0';
?>
</span></a>
</div>
<?php endif; ?>
Expand Down
6 changes: 2 additions & 4 deletions page-sitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,8 @@
<a href="javascript:;" data-action="ding" data-id="<?php the_ID(); ?>" class="favorite post-love-link <?php if(isset($_COOKIE['mzw_ding_'.$post->ID])) echo ' done';?>" title="点个赞"><i class="fa fa-heart-o"></i>
<span class="love-count">
<?php
if( get_post_meta($post->ID,'mzw_ding',true) )
echo get_post_meta($post->ID,'mzw_ding',true);
else
echo '0';
$ding_num = get_post_meta($post->ID,'mzw_ding',true);
echo $ding_num? $ding_num : '0';
?>
</span></a>
</div>
Expand Down
9 changes: 4 additions & 5 deletions page-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@
<a href="javascript:;" data-action="ding" data-id="<?php the_ID(); ?>" class="favorite post-love-link <?php if(isset($_COOKIE['mzw_ding_'.$post->ID])) echo ' done';?>" title="点个赞"><i class="fa fa-heart-o"></i>
<span class="love-count">
<?php
if( get_post_meta($post->ID,'mzw_ding',true) )
echo get_post_meta($post->ID,'mzw_ding',true);
else
echo '0';
$ding_num = get_post_meta($post->ID,'mzw_ding',true);
echo $ding_num? $ding_num : '0';
?>
</span></a>
</div>
Expand All @@ -52,5 +50,6 @@

<?php endwhile; endif;?>
</div></div>
<?php get_sidebar(); ?>

<?php get_sidebar(); ?>
<?php get_footer(); ?>
8 changes: 3 additions & 5 deletions page.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,9 @@
<a href="javascript:;" data-action="ding" data-id="<?php the_ID(); ?>" class="favorite post-love-link <?php if(isset($_COOKIE['mzw_ding_'.$post->ID])) echo ' done';?>" title="点个赞"><i class="fa fa-heart-o"></i>
<span class="love-count">
<?php
if( get_post_meta($post->ID,'mzw_ding',true) )
echo get_post_meta($post->ID,'mzw_ding',true);
else
echo '0';
?>
$ding_num = get_post_meta($post->ID,'mzw_ding',true);
echo $ding_num? $ding_num : '0';
?>
</span></a>
</div>
<?php endif; ?>
Expand Down

0 comments on commit b6916d9

Please sign in to comment.