function widget_openxtra_mostpopular($args)
 {
     // $args is an array of strings which help your widget
     // conform to the active theme: before_widget, before_title,
     // after_widget, and after_title are the array keys.
     extract($args);
     // Collect our widget's options, or define their defaults.
     $options = get_option('widget_openxtra_mostpopular');
     $title = empty($options['title']) ? __('Most Popular Post') : $options['title'];
     if (!($number = (int) $options['number'])) {
         $number = 1;
     } else {
         if ($number < 1) {
             $number = 1;
         } else {
             if ($number > 15) {
                 $number = 15;
             }
         }
     }
     // It's important to use the $before_widget, $before_title,
     // $after_title and $after_widget variables in your output.
     echo $before_widget;
     echo $before_title . $title . $after_title;
     echo '<ul>';
     akpc_most_popular($number, '<li class="recent_post">');
     echo '</ul>';
     echo $after_widget;
 }
    echo bloginfo('name');
    ?>
</a> weblog archives.</p>

			<?php 
}
?>
			</li>

			<?php 
if (!is_archive() && !is_category()) {
    ?>
			<li><h2>Most Popular Posts</h2>
				<ul>
				<?php 
    akpc_most_popular();
    ?>
				</ul>
			</li>
			<?php 
}
?>
			
			<?php 
wp_list_pages('title_li=<h2>Pages</h2>');
?>

			<li><h2>Archives</h2>
				<ul>
				<?php 
wp_get_archives('type=monthly');
Example #3
0
function arras_widget_tabbed_sidebar($args)
{
    global $wpdb;
    extract($args, EXTR_SKIP);
    $options = get_option('arras_widget_tabbed_sidebar');
    $featured = arras_get_option('featured_cat');
    ?>
	<li id="multi-sidebar-container">
	<div id="multi-sidebar" class="clearfix">
	<ul class="tabs clearfix">
	<?php 
    render_sidebar_tabs($options['order'], is_numeric($featured));
    ?>
	</ul>
	
<?php 
    foreach ($options['order'] as $tab) {
        switch ($tab) {
            case 'featured':
                if (is_numeric($featured)) {
                    ?>
	<div id="s-featured" class="widgetcontainer clearfix">
		<ul>
		<?php 
                    $f = new WP_Query('showposts=5&cat=' . $featured);
                    if (!$f->have_posts()) {
                        ?>
 <span class="textCenter sub"><?php 
                        _e('No posts at the moment. Check back again later!', 'arras');
                        ?>
</span> <?php 
                    } else {
                        while ($f->have_posts()) {
                            $f->the_post();
                            ?>
			<li><a href="<?php 
                            the_permalink();
                            ?>
"><?php 
                            the_title();
                            ?>
</a><br />
			<span class="sub"><?php 
                            the_time(__('d F Y g:i A', 'arras'));
                            ?>
 | 
			<?php 
                            comments_number(__('No Comments', 'arras'), __('1 Comment', 'arras'), __('% Comments', 'arras'));
                            ?>
</span>
			</li>    
		<?php 
                        }
                    }
                    ?>
		</ul>
	</div><!-- #s-featured -->
	<?php 
                }
                break;
            case 'latest':
                ?>
	<div id="s-latest" class="widgetcontainer clearfix">
	    <ul>
			<?php 
                $l = new WP_Query('showposts=5');
                ?>
			<?php 
                if (!$l->have_posts()) {
                    ?>
				<span class="textCenter sub"><?php 
                    _e('No posts at the moment. Check back again later!', 'arras');
                    ?>
</span>
			<?php 
                } else {
                    ?>
			<?php 
                    while ($l->have_posts()) {
                        $l->the_post();
                        ?>
				<li><a href="<?php 
                        the_permalink();
                        ?>
"><?php 
                        the_title();
                        ?>
</a><br />
				<span class="sub"><?php 
                        the_time(__('d F Y g:i A', 'arras'));
                        ?>
 | 
				<?php 
                        comments_number(__('No Comments', 'arras'), __('1 Comment', 'arras'), __('% Comments', 'arras'));
                        ?>
</span>
				</li>
			<?php 
                    }
                }
                ?>
	    </ul>
	</div><!-- #s-latest -->
	<?php 
                break;
            case 'comments':
                ?>
	<div id="s-comments" class="widgetcontainer clearfix">
		<?php 
                $comments = $wpdb->get_results("SELECT * FROM {$wpdb->comments} WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 8");
                ?>
		<ul id="recentcomments">
		<?php 
                if ($comments) {
                    foreach ($comments as $comment) {
                        echo '<li class="recentcomments">' . sprintf(__('%1$s on %2$s', 'arras'), $comment->comment_author, '<a href="' . clean_url(get_comment_link($comment->comment_ID)) . '">' . get_the_title($comment->comment_post_ID) . '</a>') . '</li>';
                    }
                }
                ?>
		</ul>
	</div><!-- #s-comments -->
	<?php 
                break;
            case 'tags':
                ?>
	<div id="s-tags" class="widgetcontainer clearfix">
        <?php 
                wp_tag_cloud('smallest=8&largest=18');
                ?>
    </div><!-- #s-tags -->
	<?php 
                break;
            case 'popular':
                ?>
	<div id="s-popular" class="widgetcontainer clearfix">
        <?php 
                if (function_exists('akpc_most_popular')) {
                    akpc_most_popular();
                }
                ?>
    </div><!-- #s-popular -->
	<?php 
                break;
        }
    }
    ?>
	</div><!-- #multi-sidebar -->
	</li><!-- #multi-sidebar-container -->
<?php 
}
Example #4
0
<?php 
    related_posts();
    ?>
</ul>
<?php 
}
?>
		

<?php 
if (function_exists('akpc_most_popular')) {
    ?>
<h3>popular</h3>
<ul>
<?php 
    akpc_most_popular($limit = 5);
    ?>
</ul>
<?php 
}
?>

<?php 
comments_template();
?>
<br/>
			
<?php 
previous_post_link('&laquo; %link', '%title');
?>
<br/>
Example #5
0
			<li title="feat"><span>Latest</span></li>
            <li title="comm"><span>Comments</span></li>
			<?php 
if (function_exists('wp_tag_cloud')) {
    ?>
<li title="tagcloud"><span>Tags</span></li><?php 
}
?>
            <li title="sub"><span>Subscribe</span></li>
		</ul>

		<div class="mootabs_panel" id="pop">
			<ul class="list1">
				<?php 
if (function_exists('akpc_most_popular')) {
    akpc_most_popular($limit = 10);
}
?>
			</ul>
        </div>

		<div id="feat" class="mootabs_panel">
	        <ul class="list2">
				<?php 
$featuredcat = get_option('premiumnews_featured_category');
// ID of the Featured Category
$the_query = new WP_Query('category_name=' . $featuredcat . '&showposts=10&orderby=post_date&order=desc');
while ($the_query->have_posts()) {
    $the_query->the_post();
    $do_not_duplicate = $post->ID;
    ?>
Example #6
0
    function widget($args, $instance)
    {
        global $wpdb;
        extract($args, EXTR_SKIP);
        if (!$instance['order']) {
            $instance['order'] = array('featured', 'latest', 'comments', 'tags');
        }
        if ($instance['display_home'] && !is_home()) {
            return;
        }
        $featured = arras_get_option('featured_cat');
        ?>
		<li id="multi-sidebar-container">
		<div id="multi-sidebar" class="clearfix">
		<ul class="tabs clearfix">
		<?php 
        $this->render_sidebar_tabs($instance['order'], is_numeric($featured));
        ?>
		</ul>
		<?php 
        foreach ($instance['order'] as $tab) {
            switch ($tab) {
                case 'featured':
                    if (is_numeric($featured)) {
                        echo '<div id="s-featured" class="widgetcontainer clearfix">';
                        $f = new WP_Query('showposts=8&cat=' . $featured);
                        if (!$f->have_posts()) {
                            echo '<span class="textCenter sub">' . __('No posts at the moment. Check back again later!', 'arras') . '</span>';
                        } else {
                            echo '<ul>';
                            while ($f->have_posts()) {
                                $f->the_post();
                                ?>
							<li class="clearfix">
							<?php 
                                if (function_exists('the_post_thumbnail')) {
                                    the_post_thumbnail('sidebar-thumb');
                                }
                                ?>
							<a href="<?php 
                                the_permalink();
                                ?>
"><?php 
                                the_title();
                                ?>
</a><br />
							<span class="sub"><?php 
                                the_time(__('d F Y g:i A', 'arras'));
                                ?>
 | 
							<?php 
                                comments_number(__('No Comments', 'arras'), __('1 Comment', 'arras'), __('% Comments', 'arras'));
                                ?>
</span>
							</li>
							<?php 
                            }
                            echo '</ul>';
                        }
                        echo '</div><!-- #s-featured -->';
                    }
                    break;
                case 'latest':
                    echo '<div id="s-latest" class="widgetcontainer clearfix">';
                    $f = new WP_Query('showposts=8');
                    if (!$f->have_posts()) {
                        echo '<span class="textCenter sub">' . __('No posts at the moment. Check back again later!', 'arras') . '</span>';
                    } else {
                        echo '<ul>';
                        while ($f->have_posts()) {
                            $f->the_post();
                            ?>
						<li class="clearfix">
						<?php 
                            if (function_exists('get_the_post_thumbnail')) {
                                echo get_the_post_thumbnail(get_the_ID(), 'sidebar-thumb');
                            }
                            ?>
						<a href="<?php 
                            the_permalink();
                            ?>
"><?php 
                            the_title();
                            ?>
</a><br />
						<span class="sub"><?php 
                            the_time(__('d F Y g:i A', 'arras'));
                            ?>
 | 
						<?php 
                            comments_number(__('No Comments', 'arras'), __('1 Comment', 'arras'), __('% Comments', 'arras'));
                            ?>
</span>
						</li>
						<?php 
                        }
                        echo '</ul>';
                    }
                    echo '</div><!-- #s-latest -->';
                    break;
                case 'comments':
                    echo '<div id="s-comments" class="widgetcontainer clearfix">';
                    $comments = $wpdb->get_results("SELECT * FROM {$wpdb->comments} WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 8");
                    if ($comments) {
                        echo '<ul id="recentcomments">';
                        foreach ($comments as $comment) {
                            echo '<li class="recentcomments clearfix">';
                            echo get_avatar($comment->user_id, 36);
                            echo '<strong>' . $comment->comment_author . '</strong><br />';
                            echo '<a href="' . clean_url(get_comment_link($comment->comment_ID)) . '">' . get_the_title($comment->comment_post_ID) . '</a>';
                            echo '</li>';
                        }
                        echo '</ul>';
                    }
                    echo '</div><!-- #s-comments -->';
                    break;
                case 'tags':
                    echo '<div id="s-tags" class="widgetcontainer clearfix">';
                    wp_tag_cloud('smallest=8&largest=18');
                    echo '</div><!-- #s-tags -->';
                    break;
                case 'popular':
                    echo '<div id="s-popular" class="widgetcontainer clearfix">';
                    if (function_exists('akpc_most_popular')) {
                        akpc_most_popular();
                    }
                    echo '</div><!-- #s-popular -->';
                    break;
            }
        }
        ?>
		</div>
		</li>
		<?php 
    }
Example #7
0
 function popular_tab()
 {
     if (function_exists('akpc_most_popular')) {
         echo '<ul>';
         akpc_most_popular(10, '<li>', '</li>');
         echo '</ul>';
     }
 }