Advertisement
Guest User

Header de tema WP

a guest
Aug 16th, 2010
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.45 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
  3. <head profile="http://gmpg.org/xfn/11">
  4.     <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
  5.     <title><?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?> - <?php bloginfo('description'); ?></title>
  6.  
  7.     <!-- Include all the Javascripts -->
  8.     <script src="<?php bloginfo('template_directory'); ?>/js/jquery-1.3.2.min.js" type="text/javascript"></script>
  9.     <script src="<?php bloginfo('template_directory'); ?>/js/jquery.cycle.all.min.js" type="text/javascript"></script>
  10.     <script src="<?php bloginfo('template_directory'); ?>/js/swfobject.js" type="text/javascript"></script>
  11.     <script type="text/javascript"> var tb_pathToImage = "<?php bloginfo('template_directory'); ?>/images/loadingAnimation.gif"; </script>
  12.     <script src="<?php bloginfo('template_directory'); ?>/js/thickbox-compressed.js" type="text/javascript" ></script>
  13.     <script src="<?php bloginfo('template_directory'); ?>/js/jquery.bt.min.js" type="text/javascript" ></script>
  14.     <script src="<?php bloginfo('template_directory'); ?>/js/jquery.pngFix.pack.js" type="text/javascript" ></script>
  15.     <script src="<?php bloginfo('template_directory'); ?>/js/cufon-yui.js" type="text/javascript" ></script>
  16.     <script src="<?php bloginfo('template_directory'); ?>/js/VAG_Rounded_Light_200.font.js" type="text/javascript" ></script>
  17.  
  18.     <!-- Get all Stylesheets -->
  19.     <link rel="stylesheet" type="text/css" media="screen" href="<?php bloginfo('template_directory'); ?>/thickbox.css" />
  20.     <link rel="stylesheet" type="text/css" media="screen" href="<?php echo get_bloginfo('stylesheet_url'); ?>" />
  21.     <link rel="stylesheet" href="<?php bloginfo('template_url');?>/pagenavi-css.css" type="text/css" media="screen" />
  22.  
  23.     <!-- Get the Color Scheme  -->
  24.     <?php $colorscheme = get_settings("ftoptions_color_scheme"); ?>
  25.     <?php
  26.     if($colorscheme == "dark")
  27.     {
  28.         ?>
  29.         <link rel="stylesheet" type="text/css" media="screen" href="<?php bloginfo('template_directory'); ?>/dark.css" />
  30.         <?php
  31.     }
  32.     else
  33.     {
  34.         ?>
  35.         <link rel="stylesheet" type="text/css" media="screen" href="<?php bloginfo('template_directory'); ?>/light.css" />
  36.         <?php
  37.     }
  38.     ?>
  39.  
  40.     <!--[if IE 6]>
  41.         <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url');?>/ie_hacks.css" />
  42.     <![endif]-->
  43.  
  44.     <script type="text/javascript">
  45.         $(document).ready(function(){
  46.             $("#logo").pngFix();
  47.             $("#content").pngFix();
  48.             $(".more").pngFix();
  49.             $(".ratings").pngFix();
  50.             $("#pageHeader").pngFix();
  51.         });
  52.     </script>
  53.  
  54.     <!-- Other Blog Metadata -->
  55.     <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
  56.     <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
  57.     <link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="<?php bloginfo('atom_url'); ?>" />
  58.     <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
  59.  
  60.     <!-- This is required for Threaded comments -->
  61.     <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
  62.  
  63.     <!-- Include other information for header -->
  64.     <?php wp_head(); ?>
  65. </head>
  66. <body>
  67.  
  68. <!-- This is the div which is displayed when page is being loaded  -->
  69. <div id="loading" style="display: none;"><img src="<?php echo get_bloginfo('template_directory'); ?>/images/ajax-loader.gif" style="float: left; margin-right: 10px;"> Loading...</div>
  70.  
  71. <div id="wrapper" style="">
  72.     <div id="header">
  73.         <div class="right topmenu">
  74.             <small>
  75.             <?php
  76.             get_currentuserinfo();
  77.             global $user_level;
  78.             if ($user_level > 0)
  79.             {
  80.                 wp_register('','');
  81.                 echo " | <a href='".wp_logout_url($redirect)."'>Logout</a>";
  82.             }
  83.             else
  84.             {
  85.                 ?>
  86.                 <?php
  87.                 echo "<a href='".wp_login_url($redirect)."'>Login</a> | ";
  88.                 ?>
  89.                 <a>/wp-login.php?action=register"><?php _e('Register') ?></a>
  90.                 <?php
  91.             }
  92.             ?>
  93.             </small>
  94.         </div>
  95.         <?php $logo = get_bloginfo('template_directory') . "/images/logo.png"; ?>
  96.         <?php
  97.         if (@fclose(@fopen($logo, "r")))
  98.         {
  99.             ?>
  100.             <a>/"><img src="<?php echo $logo; ?>" alt="<?php bloginfo('name'); ?>"></a>
  101.             <?php
  102.         }
  103.         else
  104.         {
  105.             ?>
  106.                 <h1><a>/"><?php bloginfo('name')?></a></h1>
  107.             <?php
  108.         }
  109.         ?>
  110.         <?php
  111.         $ignoredCategories = get_settings("ftoptions_ignored_categories");
  112.         $q1 = "";
  113.         if($ignoredCategories)
  114.         {
  115.             foreach ($ignoredCategories as $value)
  116.             {
  117.                 $value = str_replace(" ", "-",$value);
  118.                 $id = get_cat_id($value);
  119.                 $q1 = $q1 . $id . ",";
  120.             }
  121.             $q1 = substr($q1, 0, strlen($q1)-1);
  122.         }
  123.         $ignoredPages = get_settings("ftoptions_ignored_pages");
  124.         $q2 = "";
  125.         if($ignoredPages)
  126.         {
  127.             foreach ($ignoredPages as $value)
  128.             {
  129.                 $value = str_replace(" ", "-",$value);
  130.                 $id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = '".$value."'");
  131.                 if($id != "") {  $q2 = $q2 . $id . ",";  }
  132.             }
  133.             $q2 = substr($q2, 0, strlen($q2)-1);
  134.         }
  135.         ?>
  136.     <div class="left">
  137.         <ul id="subnavbar">
  138.             <li class="page_item<?php if(is_home()){echo(' current_page_item');} ?>"><a title="Latest">">Home</a>
  139.             <?php
  140.                 $stickyCategories = get_settings("ftoptions_sticky_categories");
  141.                 if($stickyCategories)
  142.                 {
  143.                     foreach ($stickyCategories as $value)
  144.                     {
  145.                         $value = str_replace(" ", "-",$value);
  146.                         $id = get_cat_id($value);
  147.                         wp_list_categories('include='.$id.'&title_li=');
  148.                     }
  149.                 }
  150.             ?>
  151.             <?php //wp_page_menu('show_home=0&exclude='.$q2.'&menu_class=page_item&sort_column=menu_order'); ?>
  152.             <?php wp_list_pages('title_li=&exclude='.$q2); ?>
  153.  
  154.     </div>
  155. </div>
  156.  
  157. <div class="clear"></div>
  158.  
  159. <div id="navigation">
  160.         <ul id="navbar">
  161.         <div class="right"><?php include (TEMPLATEPATH . '/searchform.php'); ?></div>
  162.         <?php
  163.             $max = (!get_settings("ftoptions_max_categories")) ? '5' : get_settings("ftoptions_max_categories");
  164.             $current_category = single_cat_title("",false);
  165.             $categories = wp_list_categories('orderby=name&titile_li=&depth=1&style=none&echo=0&exclude='.$q1);
  166.             $regex_pattern = "/<a href="(.*)" title="(.*)">(.*)<\/a>/";
  167.             preg_match_all($regex_pattern,$categories,$matches);
  168.             if(count($matches[0]) > $max) { $total = $max; } else { $total = count($matches[0]); }
  169.             for($i=0; $i<$total; $i++)
  170.             {
  171.                 $className = "";
  172.                 if( $current_category == $matches[3][$i] )
  173.                 {
  174.                     $className = "current-cat";
  175.                 }
  176.                 echo "<li class='cat-item ".$className."'>" .$matches[0][$i] . "\n";
  177.             }
  178.             if(count($matches[0]) > $max)
  179.             {
  180.                 echo "<li class='cat-item more'></a><a href=''><img style='float: left; margin-right: 5px; ' src='".get_bloginfo('template_directory')."/images/more_icon.png'> More...</a>";
  181.                 echo "<ul id='navbar_more'>";
  182.                 for($i=$max; $i<count($matches[0]); $i++)
  183.                 {
  184.                     $className = "";
  185.                     if( $current_category == $matches[3][$i] )
  186.                     {
  187.                         $className = "current-cat";
  188.                     }
  189.                     echo "<li class='children ".$className."'>" .$matches[0][$i] . "\n";
  190.                 }
  191.                 echo "";
  192.             }
  193.         ?>
  194.  
  195.     <div class="clear"></div>
  196. </div>
  197.  
  198. <?php
  199.     $tempvalue = wp_list_categories('echo=0&title_li=&style=list&child_of=' . intval(get_query_var('cat')));
  200.     if ( get_query_var('cat') && $tempvalue != "
  201. <li>No categories</li>
  202. ")
  203.     {
  204.         echo '<div style="background: #666;height: 27px;">';
  205.         echo '<ul id="navbar_sub">';
  206.         echo $tempvalue;
  207.         echo '';
  208.         echo '</div>';
  209.         echo '<div class="clear"></div>';
  210.     }
  211. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement