예제 #1
0
function dw_minion_site_actions()
{
    $social_links['facebook'] = dw_minion_get_theme_option('facebook', '');
    $social_links['twitter'] = dw_minion_get_theme_option('twitter', '');
    $social_links['google_plus'] = dw_minion_get_theme_option('google_plus', '');
    $social_links['youtube'] = dw_minion_get_theme_option('youtube', '');
    $social_links['linkedin'] = dw_minion_get_theme_option('linkedin', '');
    $social_links['github'] = dw_minion_get_theme_option('github', '');
    ?>
  <div id="actions" class="site-actions clearfix">
      <div class="action show-site-nav">
          <i class="icon-reorder"></i>
      </div>
      <div class="clearfix actions">
          <div class="action search">
              <form action="<?php 
    echo esc_url(home_url('/'));
    ?>
" class="action searchform">
                  <input type="text" placeholder="Search" id="s" name="s" class="search-query">
                  <label for="s"></label>
              </form>
          </div>
          <a class="back-top action" href="#page"><i class="icon-chevron-up"></i></a>
          <?php 
    ?>
          <div class="action socials">
              <i class="icon-link active-socials"></i>
              <?php 
    if (count($social_links) > 0) {
        ?>
<ul class="unstyled list-socials clearfix" style="width: <?php 
        echo count($social_links) * 40;
        ?>
px;">
                  <?php 
        if ($social_links['facebook'] != '') {
            ?>
<li class="social"><a href="<?php 
            echo $social_links['facebook'];
            ?>
"><i class="icon-facebook"></i></a></li><?php 
        }
        ?>
                  <?php 
        if ($social_links['twitter'] != '') {
            ?>
<li class="social"><a href="<?php 
            echo $social_links['twitter'];
            ?>
"><i class="icon-twitter"></i></a></li><?php 
        }
        ?>
                  <?php 
        if ($social_links['google_plus'] != '') {
            ?>
<li class="social"><a href="<?php 
            echo $social_links['google_plus'];
            ?>
"><i class="icon-google-plus"></i></a></li><?php 
        }
        ?>
                  <?php 
        if ($social_links['youtube'] != '') {
            ?>
<li class="social"><a href="<?php 
            echo $social_links['youtube'];
            ?>
"><i class="icon-youtube"></i></a></li><?php 
        }
        ?>
                  <?php 
        if ($social_links['linkedin'] != '') {
            ?>
<li class="social"><a href="<?php 
            echo $social_links['linkedin'];
            ?>
"><i class="icon-linkedin"></i></a></li><?php 
        }
        ?>
                  <?php 
        if ($social_links['github'] != '') {
            ?>
<li class="social"><a href="<?php 
            echo $social_links['github'];
            ?>
"><i class="icon-github"></i></a></li><?php 
        }
        ?>
              </ul><?php 
    }
    ?>
          </div>
      </div>
  </div>
  <?php 
}
예제 #2
0
function dw_minion_related_post($post_id)
{
    $tags = wp_get_post_tags($post_id);
    if ($tags) {
        $tag_ids = array();
        foreach ($tags as $individual_tag) {
            $tag_ids[] = $individual_tag->term_id;
        }
        $args = array('tag__in' => $tag_ids, 'post__not_in' => array($post_id), 'posts_per_page' => 5, 'ignore_sticky_posts' => 1);
    } else {
        $args = array('post__not_in' => array($post_id), 'posts_per_page' => 5, 'ignore_sticky_posts' => 1);
    }
    ?>

	<?php 
    $disable_related_posts = dw_minion_get_theme_option('disable_related_article', 'no');
    if ($disable_related_posts != 'yes') {
        $related_query = new wp_query($args);
        ?>
		<?php 
        if ($related_query->have_posts()) {
            ?>
		<div class="related-posts">
			<h2 class="related-posts-title"><?php 
            _e('Related Articles.', 'dw_minion');
            ?>
</h2>
			<div class="related-content">
				<?php 
            while ($related_query->have_posts()) {
                $related_query->the_post();
                ?>
				<article class="related-post clearfix">
					<h3 class="related-title"><a href="<?php 
                the_permalink();
                ?>
" rel="bookmark"><?php 
                the_title();
                ?>
</a></h3>
					<div class="related-meta"><time class="related-date"><?php 
                echo get_the_date('d M, Y');
                ?>
</time></div>
				</article>
				<?php 
            }
            ?>
			</div>
		</div>
		<?php 
        }
        ?>
	<?php 
    }
    ?>

<?php 
    wp_reset_query();
}