Пример #1
0
                
                <div class=" post_content2">
               <div class=" post_content3">
                    <h2 class="postitle_lay"><a href="<?php 
        the_permalink();
        ?>
" title="<?php 
        the_title_attribute();
        ?>
"><?php 
        the_title();
        ?>
</a></h2>
                     
                    <?php 
        hathor_excerpt('hathor_excerptlength_teaser', 'hathor_excerptmore');
        ?>
 
                    
                </div> </div>
 
                        </div>
            <?php 
    }
    ?>
 

            <?php 
}
?>
        <?php 
Пример #2
0
 function widget($args, $instance)
 {
     extract($args);
     /* Our variables from the widget settings. */
     $title = apply_filters('widget_title', $instance['title']);
     $num = $instance['num'];
     $cat = $instance['cat'];
     /* Before widget (defined by themes). */
     echo $before_widget;
     /* Display the widget title if one was input (before and after defined by themes). */
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     /* Display a containing div */
     echo '<div class="thn_feat">';
     /* Display Posts */
     if ($num) {
         $popular = new WP_Query('ignore_sticky_posts=1&cat=' . $cat . ' &posts_per_page=' . $num);
     }
     echo '<ul>';
     while ($popular->have_posts()) {
         $popular->the_post();
         echo '<li>';
         echo '<a class="thn_wgt_thumb" href="' . get_permalink(get_the_ID()) . '" title="' . get_the_title() . '">';
         if (has_post_thumbnail()) {
             echo '' . the_post_thumbnail('thumbnail') . '';
         } elseif ($photo = hathor_get_images('numberposts=1', true)) {
             echo '' . wp_get_attachment_image($photo[0]->ID, $size = 'thumbnail') . '';
         } else {
             echo '<img src="' . get_template_directory_uri() . '/images/blank_img2.png" alt="' . get_the_title() . '" class="thumbnail"/>';
         }
         echo '</a>';
         echo '<div class="widget_content">';
         echo '<a class="thn_wgt_tt" href="' . get_permalink(get_the_ID()) . '" title="' . get_the_title() . '">' . get_the_title() . '</a><br />';
         echo '' . hathor_excerpt('hathor_excerptlength_index', 'hathor_excerptmore') . '';
         echo '</div>';
         echo '</li>';
     }
     echo '</ul>';
     echo '</div>';
     /* After widget (defined by themes). */
     echo $after_widget;
 }