<?php
// Include Require Files
require_once(TEMPLATEPATH . '/inc/wp_bootstrap_navwalker.php');
require_once(TEMPLATEPATH . '/admin/admin-functions.php');
require_once(TEMPLATEPATH . '/admin/admin-interface.php');
require_once(TEMPLATEPATH . '/admin/theme-settings.php');
// Add theme post thumbnails
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size (150, 150, true, 'thumbnail');
add_image_size ('bids',200, 280, true);
add_image_size ('videos',193, 280, true);
add_image_size ('other_post',150, 220, true);
// Register Navigations
register_nav_menus(
array(
'primary' => __('منوی بازشو'),
'topnav' => __('منوی بالا')
)
);
// Func show_videos
function show_videos($atts = array()) {
extract(shortcode_atts(array(
'post_showing' => '5',
'cat_id_number' => '1'
), $atts));
$cat_not = new WP_Query("showposts=$post_showing&cat=$cat_id_number");
while ($cat_not->have_posts()) : $cat_not->the_post();?>
<li><div class="post">
<div class="col-xs-7 col-sm-4 col-md-6 col-xs-push-7 col-sm-push-10 col-md-push-8">
<?php
if (has_post_thumbnail()) {
the_post_thumbnail('videos');
}else {
echo '<img class="img-responsive" src="' . get_bloginfo( 'stylesheet_directory' ) . '/images/bid.jpg" width="200" height="275" alt="">';
}
?>
</div>
<div class="meta col-xs-7 col-sm-10 col-md-8 col-xs-pull-7 col-sm-pull-4 col-md-pull-6">
<?php the_title( '<h3 class="post-title">', '</h3>' ); ?>
<div class="q">کیفیت :
<span>
<?php
if(in_category('13443')){
echo 'سه بعدی';
}elseif(in_category('9797')){
echo 'BDRip';
}elseif(in_category('9796')){
echo 'BluRay 1080p';
}elseif(in_category('10698')){
echo 'BluRay 480P';
}elseif(in_category('8736')){
echo 'BluRay 720p';
}elseif(in_category('12676')){
echo 'BRrip';
}elseif(in_category('9100')){
echo 'CAM';
}elseif(in_category('8843')){
echo 'DVDRip';
}elseif(in_category('8772')){
echo 'DVDScr';
}elseif(in_category('10697')){
echo 'HDCAM';
}elseif(in_category('10034')){
echo 'HDRip';
}elseif(in_category('9029')){
echo 'HDTV';
}elseif(in_category('9136')){
echo 'WEB-DL';
}elseif(in_category('8726')){
echo 'WEBRip';
}else {
echo 'دیگر...';
}
?>
</span>
</div>
<div class="s">ژانر : <span>
<?php
if(in_category('337')){
echo 'اسرار آمیز';
}elseif(in_category('289')){
echo 'انیمیشن';
}elseif(in_category('38')){
echo 'اکشن';
}elseif(in_category('328')){
echo 'تاریخی';
}elseif(in_category('72')){
echo 'ترسناک';
}elseif(in_category('110')){
echo 'جنایی';
}elseif(in_category('121')){
echo 'جنگی';
}elseif(in_category('279')){
echo 'خانوادگی';
}elseif(in_category('51')){
echo 'درام';
}elseif(in_category('3288')){
echo 'رازآلود';
}elseif(in_category('1250')){
echo 'زندگی نامه';
}elseif(in_category('146')){
echo 'عاشقانه';
}elseif(in_category('40')){
echo 'علمی تخیلی';
}elseif(in_category('441')){
echo 'فانتزی';
}elseif(in_category('39')){
echo 'ماجراجویی';
}elseif(in_category('1249')){
echo 'مستند';
}elseif(in_category('52')){
echo 'معمائی';
}elseif(in_category('2998')){
echo 'موزیکال';
}elseif(in_category('53')){
echo 'هیجان انگیز';
}elseif(in_category('14346')){
echo 'ورزشی';
}elseif(in_category('9784')){
echo 'وسترن';
}elseif(in_category('26')){
echo 'کمدی';
}else{
echo 'دیگر...';
}
?>
</span></div>
<div class="v">بازدید : <span><?php if(function_exists('the_views')) { the_views(); } ?></span></div>
<div class="c">نظرات : <span><?php comments_popup_link ('بدون نظر ','1 نظر','% نظر'); ?></span></div>
<div class="m"><a href="<?php the_permalink(); ?>">ادامه مطلب</a></div>
</div>
<br class="clear">
<hr>
</div></li>
<?php PHP_EOL;
endwhile;
}
add_shortcode('show_videos', 'show_videos');
// Func show_bids
function show_bids($atts = array()) {
extract(shortcode_atts(array(
'post_showing' => '5',
'cat_id_number' => '1'
), $atts));
$cat_not = new WP_Query("showposts=$post_showing&cat=$cat_id_number");
while ($cat_not->have_posts()) : $cat_not->the_post();?>
<li><a href="<?php the_permalink(); ?>">
<?php
if (has_post_thumbnail()) {
the_post_thumbnail('bids');
}
else {
echo '<img class="img-responsive" src="' . get_bloginfo( 'stylesheet_directory' ) . '/images/bid.jpg" width="200" height="275" alt="">';
}
?>
<?php the_title( '<h3 class="post-title">', '</h3>' ); ?>
</a></li>
<?php PHP_EOL;
endwhile;
}
add_shortcode('show_bids', 'show_bids');
// Func show_side
function show_side($atts = array()) {
extract(shortcode_atts(array(
'post_showing' => '5',
'cat_id_number' => '1'
), $atts));
$cat_not = new WP_Query("showposts=$post_showing&cat=$cat_id_number");
while ($cat_not->have_posts()) : $cat_not->the_post();?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php PHP_EOL;
endwhile;
}
add_shortcode('show_side', 'show_side');?>
<?php
if (!function_exists('bootstrapwp_comment')) :
function bootstrapwp_comment($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
switch ($comment->comment_type) :
default :
// Proceed with normal comments.
global $post; ?>
<li class="comment <?php if (1==$comment->user_id) echo 'admin'; ?>" id="li-comment-<?php comment_ID(); ?>">
<div class="comment-body">
<div class="comment-author">
<a href="<?php echo $comment->comment_author_url;?>" style="display: inline-block;">
<?php echo get_avatar($comment, 32); ?>
</a>
<cite><?php echo get_comment_author_link(); ?></cite>
<?php comment_reply_link( array_merge($args, array(
'reply_text' => __('پاسخ'),
'depth' => $depth,
'max_depth' => $args['max_depth']
)
)); ?>
<span dir="rtl">(<?php comment_date('d M Y'); ?>)</span>
</div>
<?php if ('0' == $comment->comment_approved) : ?>
<p class="comment-awaiting-moderation"><?php _e(
'دیدگاه شما در انتظار بررسی است.'
); ?></p>
<?php endif; ?>
<p>
<?php comment_text(); ?>
</p>
</div>
<!--/.media-body -->
<?php
break;
endswitch;
}
endif;
// Sidebar
if ( function_exists('register_sidebar') ) {
register_sidebar(array(
'name' => 'ستون سمت راست',
'id' => 'right',
'before_widget' => '<div class="panel"><div class="panel-heading">',
'before_title' => '<h3 class="panel-title"><span>',
'after_title' => '</span></h3></div><div class="panel-body">',
'after_widget' => '</div></div>'
));
}