Advertisement
SRD75

new index.php

Jun 14th, 2013
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.91 KB | None | 0 0
  1. <?php
  2. get_header();
  3.  
  4. //OptionTree Stuff
  5. $menuCat = ot_get_option('menu_cat');
  6. $logo = ot_get_option('logo');
  7. $homeInfo = ot_get_option('home_info');
  8. ?>
  9.  
  10. <div class="section" id="cover">
  11.     <div id="coverContent">
  12.         <?php if($logo){ ?><a id="logo" href="<?php echo home_url(); ?>"><img src="<?php echo $logo ?>" alt="<?php bloginfo('name'); ?>" /></a><?php } ?><!--end logo-->
  13.         <h2><?php echo get_bloginfo ( 'description' );  ?></h2>
  14.         <?php if($homeInfo){?>
  15.         <div id="homeInfo">
  16.             <?php echo $homeInfo; ?>
  17.         </div><!--end homeInfo-->
  18.         <?php } ?>
  19.     </div><!--end coverContent-->
  20.  
  21.     <?php if($menuCat){ ?>
  22.     <div id="continueOn">
  23.         <?php echo get_cat_name($menuCat).'<br />&darr;' ;?>
  24.     </div><!--end continueOn-->
  25.     <?php } ?>
  26.    
  27. </div><!--end section-->
  28.  
  29. <?php if($menuCat){?>
  30. <div id="menuStuff">
  31.  
  32. <div id="menuNavigation">
  33.     <ul id="menuMenu"></ul>
  34. </div><!--end menuNavigation-->
  35.  
  36.     <?php $args=array(
  37.     'orderby' => 'slug',
  38.     'order' => 'ASC',
  39.     'parent' => $menuCat
  40.     );
  41.     $categories=get_categories($args);
  42.     foreach($categories as $category) {
  43.         $catName = $category->name;
  44.         $catName = strtolower($catName);
  45.         $catName = str_replace (" ", "", $catName);
  46.         $catName = str_replace ("&amp;", "", $catName);
  47.         $catName = str_replace ("é", "e", $catName);
  48.     ?>
  49.     <div class="menuSection section" id="<?php echo $catName; ?>">
  50.         <div class="titles"><h2><?php echo $category->name; ?></h2></div>
  51.         <?php if($category->description){ ?>
  52.             <p class="catDescription"><?php echo $category->description; ?></p>
  53.         <?php } ?>
  54.    
  55.         <?php $args=array(
  56.         'orderby' => 'slug',
  57.         'order' => 'ASC',
  58.         'parent' => $category->term_id
  59.         );
  60.         $subcategories=get_categories($args);
  61.         foreach($subcategories as $subcategory) {
  62.  
  63.             $showPostsInSubCategory = new WP_Query();
  64.             $showPostsInSubCategory->query('cat='.$subcategory->term_id.'&showposts=100');
  65.         ?>
  66.         <h2 class="categoryname"><?php echo $subcategory->name; ?></h2>
  67.         <div class="sectionContent">
  68.        
  69.         <?php
  70.             while ($showPostsInSubCategory->have_posts()) : $showPostsInSubCategory->the_post();
  71.             $data = get_post_meta( $post->ID, 'key', true );
  72.         ?>
  73.             <div class="post">
  74.             <?php if (has_post_thumbnail()) {$large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large');?>
  75.                 <a class="picIcon" title="<?php the_title(); ?>" rel="prettyPhoto[gallery<?php the_id(); ?>]"  href="<?php echo $large_image_url[0]; ?>" title="<?php the_title_attribute(); ?>"></a>
  76.                 <?php } if ($data[ 'price' ]) { ?>
  77.                 <h3><?php echo $data[ 'price' ]; ?></h3>
  78.                 <?php } ?>
  79.                 <h2><?php the_title(); ?></h2>
  80.                 <?php
  81.                     the_content(__(' Continue Reading','themolitor'));
  82.                     attachment_menu();
  83.                 ?>
  84.             </div><!--end post-->
  85.             <?php endwhile;?>
  86.         </div><!--end sectionContent-->
  87.         <?php
  88.         wp_reset_postdata();
  89.         } ?>
  90.     </div><!--end section-->
  91.     <?php
  92.     wp_reset_postdata();
  93.     } ?>
  94. </div><!--end menuStuff-->
  95. <?php }
  96. get_footer();
  97. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement