Guest User

My Code

a guest
Aug 27th, 2014
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.43 KB | None | 0 0
  1. ( Ветка форума с вопросом: http://ru.forums.wordpress.org/topic/%D0%9A%D0%B0%D0%BA-%D1%80%D0%B5%D0%B4%D0%B0%D0%BA%D1%82%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D1%82%D1%8C-%D1%81%D1%82%D0%B0%D1%82%D0%B8%D1%81%D1%82%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D1%83%D1%8E-%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D1%83?replies=11#post-161732 )
  2.  
  3. <!DOCTYPE html>
  4. <?php $mts_options = get_option('point'); ?>
  5. <html class="no-js" <?php language_attributes(); ?>>
  6. <head>
  7.     <meta charset="<?php bloginfo('charset'); ?>">
  8.     <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
  9.     <!--[if IE ]>
  10.     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  11.     <![endif]-->
  12.     <link rel="profile" href="http://gmpg.org/xfn/11" />
  13.     <title><?php wp_title( '|', true, 'right' ); ?></title>
  14.     <?php mts_meta(); ?>
  15.     <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
  16.     <?php wp_head(); ?>
  17. </head>
  18. <body id ="blog" <?php body_class('main'); ?>>
  19.     <div class="main-container">
  20.         <?php if(isset($mts_options['mts_trending_articles'])) { if($mts_options['mts_trending_articles'] == '1' && $mts_options['mts_trending_articles'] != '') { ?>
  21.             <div class="trending-articles">
  22.                 <ul>
  23.                     <li class="firstlink"><?php _e('Now Trending','mythemeshop'); ?>:</li>
  24.                     <?php $i = 1; $my_query = new wp_query( 'cat='.$mts_options['mts_trending_articles_cat'].'&posts_per_page=4&ignore_sticky_posts=1' ); ?>
  25.                     <?php if ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post(); ?>
  26.                         <li class="trendingPost <?php if($i % 4 == 0){echo 'last';} ?>">
  27.                             <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="bookmark"><?php mts_short_title('...', 24); ?></a>
  28.                         </li>                  
  29.                     <?php $i++; endwhile; endif;?>
  30.                 </ul>
  31.             </div>
  32.         <?php }} ?>
  33.         <header class="main-header">
  34.             <div id="header">
  35.                 <?php if ($mts_options['mts_logo'] != '') { ?>
  36.                     <?php if( is_front_page() || is_home() || is_404() ) { ?>
  37.                             <h1 id="logo" class="image-logo">
  38.                                 <?php list($width, $height, $type, $attr) = getimagesize($mts_options['mts_logo']); ?>
  39.                                 <a href="<?php echo home_url(); ?>"><img src="<?php echo $mts_options['mts_logo']; ?>" alt="<?php bloginfo( 'name' ); ?>" <?php echo $attr; ?>></a>
  40.                             </h1><!-- END #logo -->
  41.                     <?php } else { ?>
  42.                           <h2 id="logo" class="image-logo">
  43.                                 <?php list($width, $height, $type, $attr) = getimagesize($mts_options['mts_logo']); ?>
  44.                                 <a href="<?php echo home_url(); ?>"><img src="<?php echo $mts_options['mts_logo']; ?>" alt="<?php bloginfo( 'name' ); ?>" <?php echo $attr; ?>></a>
  45.                             </h2><!-- END #logo -->
  46.                     <?php } ?>
  47.                 <?php } else { ?>
  48.                     <?php if( is_front_page() || is_home() || is_404() ) { ?>
  49.                             <h1 id="logo" class="text-logo">
  50.                                 <a href="<?php echo home_url(); ?>"><?php bloginfo( 'name' ); ?></a>
  51.                             </h1><!-- END #logo -->
  52.                     <?php } else { ?>
  53.                           <h2 id="logo" class="text-logo">
  54.                                 <a href="<?php echo home_url(); ?>"><?php bloginfo( 'name' ); ?></a>
  55.                             </h2><!-- END #logo -->
  56.                     <?php } ?>
  57.                 <?php } ?>
  58.                 <div class="secondary-navigation">
  59.                     <nav id="navigation" >
  60.                         <?php if ( has_nav_menu( 'primary-menu' ) ) { ?>
  61.                             <?php $walker = new mts_Walker; wp_nav_menu( array( 'theme_location' => 'primary-menu', 'menu_class' => 'menu', 'container' => '', 'walker' => $walker ) ); ?>
  62.                         <?php } else { ?>
  63.                             <ul class="menu">
  64.                                 <?php wp_list_categories('title_li='); ?>
  65.                             </ul>
  66.                         <?php } ?>
  67.                         <a href="#" id="pull"><?php _e('Menu','mythemeshop'); ?></a>
  68.                     </nav>
  69.                 </div>
  70.             </div>
  71.         </header>
  72.         <?php if ($mts_options['mts_header_adcode'] != '') { ?>
  73.             <div class="header-bottom-second">
  74.                 <?php echo '<div id="header-widget-container">';
  75.                 if ($mts_options['mts_header_adcode'] != ''){
  76.                     echo '<div class="widget-header">';
  77.                     echo $mts_options['mts_header_adcode'];
  78.                     echo '</div>';
  79.                 }
  80.                 ?>
  81.                 <?php if ($mts_options['mts_posttopleft_adcode'] != ''){ ?>
  82.                     <div class="widget-header-bottom-right">
  83.                         <div class="textwidget">
  84.                             <div class="topad"><?php echo $mts_options['mts_posttopleft_adcode']; ?> </div>
  85.                         </div>
  86.                     </div>
  87.                 <?php } ?>
  88.         <?php echo '</div></div>'; } ?>
  89.         <?php if(isset($mts_options['mts_featured_slider'])) { if($mts_options['mts_featured_slider'] == '1' && $mts_options['mts_featured_slider'] != '') { ?>
  90.             <?php if(is_home() && !is_paged()) { ?>
  91.                 <div class="featuredBox">
  92.                     <?php $i = 1;
  93.                         // prevent implode error
  94.                         if (empty($mts_options['mts_featured_slider_cat']) || !is_array($mts_options['mts_featured_slider_cat'])) {
  95.                             $mts_options['mts_featured_slider_cat'] = array('0');
  96.                         }
  97.                         $slider_cat = implode(",", $mts_options['mts_featured_slider_cat']);
  98.                         $my_query = new WP_Query('cat='.$slider_cat.'&posts_per_page=4&ignore_sticky_posts=1');
  99.                         while ($my_query->have_posts()) : $my_query->the_post(); ?>
  100.                         <?php if($i == 1){ ?>
  101.                             <div class="firstpost excerpt">
  102.                                 <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="nofollow" id="first-thumbnail">
  103.                                     <?php if ( has_post_thumbnail() ) { ?>
  104.                                         <?php the_post_thumbnail('bigthumb',array('title' => '')); ?>
  105.                                     <?php } else { ?>
  106.                                         <div class="featured-thumbnail">
  107.                                             <img src="<?php echo get_template_directory_uri(); ?>/images/bigthumb.png" class="attachment-featured wp-post-image" alt="<?php the_title(); ?>">
  108.                                         </div>
  109.                                     <?php } ?>
  110.                                     <p class="featured-excerpt">
  111.                                         <span class="featured-title"><?php the_title(); ?></span>
  112.                                         <span class="f-excerpt"><?php echo mts_excerpt(10);?></span>
  113.                                     </p>
  114.                                 </a>
  115.                             </div><!--.post excerpt-->
  116.                         <?php } elseif($i == 2) { ?>
  117.                             <div class="secondpost excerpt">
  118.                                 <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="nofollow" id="second-thumbnail">
  119.                                     <?php if ( has_post_thumbnail() ) { ?>
  120.                                         <?php the_post_thumbnail('mediumthumb',array('title' => '')); ?>
  121.                                     <?php } else { ?>
  122.                                         <div class="featured-thumbnail">
  123.                                             <img src="<?php echo get_template_directory_uri(); ?>/images/mediumthumb.png" class="attachment-featured wp-post-image" alt="<?php the_title(); ?>">
  124.                                         </div>
  125.                                     <?php } ?>
  126.                                     <p class="featured-excerpt">
  127.                                         <span class="featured-title"><?php the_title(); ?></span>
  128.                                     </p>
  129.                                 </a>
  130.                             </div><!--.post excerpt-->
  131.                         <?php } elseif($i == 3 || $i == 4) { ?>
  132.                             <div class="thirdpost excerpt">
  133.                                 <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="nofollow" id="third-thumbnail">
  134.                                     <?php if ( has_post_thumbnail() ) { ?>
  135.                                         <?php the_post_thumbnail('smallthumb',array('title' => '')); ?>
  136.                                     <?php } else { ?>
  137.                                         <div class="featured-thumbnail">
  138.                                             <img src="<?php echo get_template_directory_uri(); ?>/images/smallfthumb.png" class="attachment-featured wp-post-image" alt="<?php the_title(); ?>">
  139.                                         </div>
  140.                                     <?php } ?>
  141.                                     <p class="featured-excerpt">
  142.                                         <span class="featured-title"><?php the_title(); ?></span>
  143.                                     </p>
  144.                                 </a>
  145.                             </div><!--.post excerpt-->
  146.                         <?php } ?>                  
  147.                     <?php $i++; endwhile; wp_reset_query(); ?>
  148.                 </div>
  149.             <?php } ?>
  150.         <?php }} ?>
Advertisement
Add Comment
Please, Sign In to add comment