コード例 #1
0
ファイル: link.php プロジェクト: DavidSalzer/cambium-site
<li <?php 
post_class();
?>
>
            
	<h2 class="singletitle"><a href="<?php 
echo get_post_meta($post->ID, 'tmnf_linkss', true);
?>
"><?php 
echo tmnf_icon();
?>
 <?php 
_e('[Link]', 'themnific');
?>
 <?php 
the_title();
?>
</a></h2>
    
            <div class="hrline"><span></span></div>  
            
            <p class="meta">
            
                <i class="fa fa-clock-o"></i> <span><?php 
_e('On', 'themnific');
?>
</span>  <?php 
the_time(get_option('date_format'));
?>
 | 
                <i class="fa fa-file-o"></i> <span> <?php 
コード例 #2
0
    function widget($args, $instance)
    {
        extract($args);
        $title = $instance['title'];
        $post_type = 'all';
        $categories = $instance['categories'];
        $posts = $instance['posts'];
        echo $before_widget;
        ?>

		
		<?php 
        $post_types = get_post_types();
        unset($post_types['page'], $post_types['attachment'], $post_types['revision'], $post_types['nav_menu_item']);
        if ($post_type == 'all') {
            $post_type_array = $post_types;
        } else {
            $post_type_array = $post_type;
        }
        ?>


			<h2 class="widget widget-single inn"><a href="<?php 
        echo esc_url(get_category_link($categories));
        ?>
"><?php 
        echo esc_html($title);
        ?>
</a></h2>
			
			<?php 
        $recent_posts = new WP_Query(array('showposts' => $posts, 'cat' => $categories));
        ?>

            <ul>
			<?php 
        while ($recent_posts->have_posts()) {
            $recent_posts->the_post();
            ?>


			<li class="fblock">
                    
					<?php 
            if (has_post_thumbnail()) {
                ?>

                         <a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                the_title();
                ?>
" >
                         <?php 
                the_post_thumbnail('tabs', array('title' => ""));
                ?>

                         </a>
                    <?php 
            }
            ?>

                        
                    <h3><a href="<?php 
            the_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
"><?php 
            echo tmnf_icon();
            ?>
 <?php 
            echo short_title('...', 11);
            ?>
</a></h3>
                    <p class="meta">
                    
                    	<?php 
            the_time(get_option('date_format'));
            ?>
 &bull; <?php 
            comments_popup_link(__('Comments (0)', 'themnific'), __('Comments (1)', 'themnific'), __('Comments (%)', 'themnific'));
            ?>

                    
                    </p>
                        
			</li>

			<?php 
        }
        ?>

			</ul>

		
		<?php 
        echo $after_widget;
    }