Advertisement
Guest User

Tiny Categories - Maggie - WordPress

a guest
Jul 22nd, 2012
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.09 KB | None | 0 0
  1. <?php
  2. /* Tiny Category List Options */
  3. $tiny_category_list_number  = mt_get_option('maggie_tiny_category_list_number');
  4.  
  5. /* Tiny category list one */
  6. $tiny_category_id_one       = mt_get_option('maggie_tiny_category_list_cat_one');
  7. $tiny_category_name_one     = get_cat_name($tiny_category_id_one);
  8. $tiny_category_link_one     = get_category_link($tiny_category_id_one);
  9.  
  10. /* Tiny category list two */
  11. $tiny_category_id_two       = mt_get_option('maggie_tiny_category_list_cat_two');
  12. $tiny_category_name_two     = get_cat_name($tiny_category_id_two);
  13. $tiny_category_link_two     = get_category_link($tiny_category_id_two);
  14.  
  15. /* Tiny category list three */
  16. $tiny_category_id_three     = mt_get_option('maggie_tiny_category_list_cat_three');
  17. $tiny_category_name_three   = get_cat_name($tiny_category_id_three);
  18. $tiny_category_link_three   = get_category_link($tiny_category_id_three);
  19. ?>
  20.  
  21. <?php if ($tiny_category_id_one == true) : ?>
  22. <div class="block_11 alpha">
  23.     <div class="list-entry tiny-list clearfix">
  24.         <h4 class="widget-title"><span><a href="<?php echo ($tiny_category_link_one); ?>" title="<?php echo ($tiny_category_name_one); ?>"><?php echo ($tiny_category_name_one); ?></a></span></h4>
  25.         <ul>
  26.             <?php
  27.             $tiny_category_list = new WP_Query(); // set a new the query.
  28.             $tiny_category_list->query('posts_per_page='.$tiny_category_list_number.'&cat='.$tiny_category_id_one);
  29.             if ($tiny_category_list->have_posts()) : while ($tiny_category_list->have_posts()) : $tiny_category_list->the_post();
  30.             ?>
  31.             <li>
  32.                 <article <?php post_class(); ?>>
  33.                     <div class="entry-header">
  34.                         <h5 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'maggie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php echo substr(get_the_title(), 0, 58); if(strlen(get_the_title()) > 58) : ?>...<?php endif; ?></a></h5>
  35.                         <div class="entry-meta">
  36.                             <?php the_time('F j, Y');?>
  37.                             <?php _e(', ','maggie'); comments_popup_link(__('No comments', 'maggie'), __('1 comment', 'maggie'), __('% comments', 'maggie')); ?>
  38.                         </div>
  39.                     </div>
  40.                 </article>
  41.             </li>
  42.             <?php endwhile; ?>
  43.             <?php endif; ?>
  44.             <?php wp_reset_query(); // kick the query ass. ?>
  45.         </ul>
  46.     </div><!-- .tiny-list-entry-two-->
  47. </div>
  48. <?php endif; ?>
  49.  
  50. <?php if ($tiny_category_id_two == true) : ?>
  51. <div class="block_11">
  52.     <div class="list-entry tiny-list clearfix">
  53.         <h4 class="widget-title"><span><a href="<?php echo ($tiny_category_link_two); ?>" title="<?php echo ($tiny_category_name_two); ?>"><?php echo ($tiny_category_name_two); ?></a></span></h4>
  54.         <ul>
  55.             <?php
  56.             $tiny_category_list = new WP_Query(); // set a new the query.
  57.             $tiny_category_list->query('posts_per_page='.$tiny_category_list_number.'&cat='.$tiny_category_id_two);
  58.             if ($tiny_category_list->have_posts()) : while ($tiny_category_list->have_posts()) : $tiny_category_list->the_post();
  59.             ?>
  60.             <li>
  61.                 <article <?php post_class(); ?>>
  62.                     <div class="entry-header">
  63.                         <h5 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'maggie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php echo substr(get_the_title(), 0, 58); if(strlen(get_the_title()) > 58) : ?>...<?php endif; ?></a></h5>
  64.                         <div class="entry-meta">
  65.                             <?php the_time('F j, Y');?>
  66.                             <?php _e(', ','maggie'); comments_popup_link(__('No comments', 'maggie'), __('1 comment', 'maggie'), __('% comments', 'maggie')); ?>
  67.                         </div>
  68.                     </div>
  69.                 </article>
  70.             </li>
  71.             <?php endwhile; ?>
  72.             <?php endif; ?>
  73.             <?php wp_reset_query(); // kick the query ass. ?>
  74.         </ul>
  75.     </div><!-- .tiny-list-entry-two-->
  76. </div>
  77. <?php endif; ?>
  78.  
  79. <?php if ($tiny_category_id_three == true) : ?>
  80. <div class="block_11 omega">
  81.     <div class="list-entry tiny-list clearfix">
  82.         <h4 class="widget-title"><span><a href="<?php echo ($tiny_category_link_three); ?>" title="<?php echo ($tiny_category_name_three); ?>"><?php echo ($tiny_category_name_three); ?></a></span></h4>
  83.         <ul>
  84.             <?php
  85.             $tiny_category_list = new WP_Query(); // set a new the query.
  86.             $tiny_category_list->query('posts_per_page='.$tiny_category_list_number.'&cat='.$tiny_category_id_three);
  87.             if ($tiny_category_list->have_posts()) : while ($tiny_category_list->have_posts()) : $tiny_category_list->the_post();
  88.             ?>
  89.             <li>
  90.                 <article <?php post_class(); ?>>
  91.                     <div class="entry-header">
  92.                         <h5 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'maggie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php echo substr(get_the_title(), 0, 58); if(strlen(get_the_title()) > 58) : ?>...<?php endif; ?></a></h5>
  93.                         <div class="entry-meta">
  94.                             <?php the_time('F j, Y');?>
  95.                             <?php _e(', ','maggie'); comments_popup_link(__('No comments', 'maggie'), __('1 comment', 'maggie'), __('% comments', 'maggie')); ?>
  96.                         </div>
  97.                     </div>
  98.                 </article>
  99.             </li>
  100.             <?php endwhile; ?>
  101.             <?php endif; ?>
  102.             <?php wp_reset_query(); // kick the query ass. ?>
  103.         </ul>
  104.     </div><!-- .tiny-list-entry-three-->
  105. </div>
  106. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement