Advertisement
Guest User

Untitled

a guest
Sep 21st, 2011
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 11.42 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  
  5.  * The Header for our theme.
  6.  
  7.  *
  8.  
  9.  * Displays all of the <head> section and everything up till <div id="main">
  10.  
  11.  *
  12.  
  13.  * @package WordPress
  14.  
  15.  * @subpackage Third_Style
  16.  
  17.  * @since Third Style 1.0
  18.  
  19.  */
  20.  
  21. ?><!DOCTYPE html>
  22.  
  23. <html <?php language_attributes(); ?>>
  24.  
  25. <head>
  26.  
  27. <meta charset="<?php bloginfo( 'charset' ); ?>" />
  28.  
  29. <title><?php
  30.  
  31.     /*
  32.  
  33.      * Print the <title> tag based on what is being viewed.
  34.  
  35.      */
  36.  
  37.     global $page, $paged;
  38.  
  39.     wp_title( '|', true, 'right' );
  40.  
  41.     // Add the blog name.
  42.  
  43.     bloginfo( 'name' );
  44.  
  45.     // Add the blog description for the home/front page.
  46.  
  47.     $site_description = get_bloginfo( 'description', 'display' );
  48.  
  49.     if ( $site_description && ( is_home() || is_front_page() ) )
  50.  
  51.         echo " | $site_description";
  52.  
  53.     // Add a page number if necessary:
  54.  
  55.     if ( $paged >= 2 || $page >= 2 )
  56.  
  57.         echo ' | ' . sprintf( __( 'Page %s', 'thirdstyle' ), max( $paged, $page ) );
  58.  
  59.     ?></title>
  60.  
  61. <link rel="profile" href="http://gmpg.org/xfn/11" />
  62.  
  63. <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
  64.  
  65. <link href='http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:regular,bold' rel='stylesheet' type='text/css'>
  66.  
  67. <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
  68.  
  69. <?php
  70.  
  71.     /* We add some JavaScript to pages with the comment form
  72.  
  73.      * to support sites with threaded comments (when in use).
  74.  
  75.      */
  76.  
  77.     if ( is_singular() && get_option( 'thread_comments' ) )
  78.  
  79.         wp_enqueue_script( 'comment-reply' );
  80.  
  81.     /* Always have wp_head() just before the closing </head>
  82.  
  83.      * tag of your theme, or you will break many plugins, which
  84.  
  85.      * generally use this hook to add elements to <head> such
  86.  
  87.      * as styles, scripts, and meta tags.
  88.  
  89.      */
  90.  
  91.     wp_head();
  92.  
  93. ?>
  94.  
  95. <meta name="msvalidate.01" content="A4962161B04CBAF2D3E34CD057A2DED0" />
  96.  
  97. <META content='8f065d23dbd43a8b' name='y_key'/>
  98.  
  99. <!-- FWXnQi3jQRnEMyu7KBeKEeA7TGk  -->  
  100.  
  101.         <meta content='FWXnQi3jQRnEMyu7KBeKEeA7TGk' name='alexaVerifyID'/>  
  102.  
  103.         <meta content='keyword1,keyword2,FWXnQi3jQRnEMyu7KBeKEeA7TGk' name='keywords'/>
  104.  
  105. </head>
  106.  
  107. <body <?php body_class(); ?>>
  108.  
  109. <div id="wrapper" class="hfeed">
  110.  
  111.     <div id="header" style="background:url(<?php header_image(); ?>) no-repeat top left;">
  112.  
  113.         <div id="masthead">
  114.  
  115.             <div id="branding" role="banner">
  116.  
  117.                     <div id="pao_search"><?php get_search_form(); ?></div>
  118.  
  119.                 <?php $heading_tag = ( is_home() || is_front_page() ) ? 'div' : 'div'; ?>
  120.  
  121.                 <<?php echo $heading_tag; ?> id="site-title">
  122.  
  123.                     <span>
  124.  
  125.                     </span>
  126.  
  127.                 </<?php echo $heading_tag; ?>>
  128.  
  129.                 <div id="site-description"><?php bloginfo( 'description' ); ?></div>
  130.  
  131.             </div><!-- #branding -->
  132.  
  133.             <div id="access" role="navigation">
  134.  
  135.               <?php /*  Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
  136.  
  137.                 <div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'thirdstyle' ); ?>"><?php _e( 'Skip to content', 'thirdstyle' ); ?></a></div>
  138.  
  139.                 <?php /* Our navigation menu.  If one isn't filled out, wp_nav_menu falls back to wp_page_menu.  The menu assiged to the primary position is the one used.  If none is assigned, the menu with the lowest ID is used.  */ ?>
  140.  
  141.                 <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
  142.  
  143.             </div><!-- #access -->
  144.  
  145.         </div><!-- #masthead -->
  146.  
  147. <div style="clear:both;"></div>
  148.  
  149.     </div>
  150.  
  151. <!-- #header -->
  152.  
  153.     <div id="main">
  154. `
  155. Loop:
  156. `
  157. <?php
  158. /**
  159.  * The loop that displays posts.
  160.  *
  161.  * The loop displays the posts and the post content.  See
  162.  * http://codex.wordpress.org/The_Loop to understand it and
  163.  * http://codex.wordpress.org/Template_Tags to understand
  164.  * the tags used in it.
  165.  *
  166.  * This can be overridden in child themes with loop.php or
  167.  * loop-template.php, where 'template' is the loop context
  168.  * requested by a template. For example, loop-index.php would
  169.  * be used if it exists and we ask for the loop with:
  170.  * <code>get_template_part( 'loop', 'index' );</code>
  171.  *
  172.  * @package WordPress
  173.  * @subpackage Third_Style
  174.  * @since Third Style 1.0
  175.  */
  176. ?>
  177.  
  178. <?php /* Display navigation to next/previous pages when applicable */ ?>
  179. <?php if ( $wp_query->max_num_pages > 1 ) : ?>
  180.     <div id="nav-above" class="navigation">
  181.         <div class="nav-previous"></div>
  182.         <div class="nav-next"></div>
  183.     </div><!-- #nav-above -->
  184. <?php endif; ?>
  185.  
  186. <?php /* If there are no posts to display, such as an empty archive page */ ?>
  187. <?php if ( ! have_posts() ) : ?>
  188.     <div id="post-0" class="post error404 not-found">
  189.         <h1 class="entry-title"><?php _e( 'Not Found', 'thirdstyle' ); ?></h1>
  190.         <div class="entry-content">
  191.             <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'thirdstyle' ); ?></p>
  192.             <?php get_search_form(); ?>
  193.         </div><!-- .entry-content -->
  194.     </div><!-- #post-0 -->
  195. <?php endif; ?>
  196.  
  197. <?php
  198.     /* Start the Loop.
  199.      *
  200.      * In Third Style we use the same loop in multiple contexts.
  201.      * It is broken into three main parts: when we're displaying
  202.      * posts that are in the gallery category, when we're displaying
  203.      * posts in the asides category, and finally all other posts.
  204.      *
  205.      * Additionally, we sometimes check for whether we are on an
  206.      * archive page, a search page, etc., allowing for small differences
  207.      * in the loop on each template without actually duplicating
  208.      * the rest of the loop that is shared.
  209.      *
  210.      * Without further ado, the loop:
  211.      */ ?>
  212. <?php while ( have_posts() ) : the_post(); ?>
  213.  
  214. <?php /* How to display posts in the Gallery category. */ ?>
  215.  
  216.     <?php if ( in_category( _x('gallery', 'gallery category slug', 'thirdstyle') ) ) : ?>
  217.         <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  218.             <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( ' %s', 'thirdstyle' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  219.  
  220.             <div class="entry-meta">
  221.                 <?php thirdstyle_posted_on(); ?>
  222.             </div><!-- .entry-meta -->
  223.  
  224.             <div class="entry-content">
  225. <?php if ( post_password_required() ) : ?>
  226.                 <?php the_content(); ?>
  227. <?php else : ?>
  228.                 <?php
  229.                     $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
  230.                     if ( $images ) :
  231.                         $total_images = count( $images );
  232.                         $image = array_shift( $images );
  233.                         $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );
  234.                 ?>
  235.                         <div class="gallery-thumb">
  236.                             <a class="size-thumbnail" href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>
  237.                         </div><!-- .gallery-thumb -->
  238.                         <p><em><?php printf( __( 'This gallery contains <a %1$s>%2$s photos</a>.', 'thirdstyle' ),
  239.                                 'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( ' %s', 'thirdstyle' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
  240.                                 $total_images
  241.                             ); ?></em></p>
  242.                 <?php endif; ?>
  243.                         <?php the_excerpt(); ?>
  244. <?php endif; ?>
  245.             </div><!-- .entry-content -->
  246.  
  247.             <div class="entry-utility">
  248.                 <a href="<?php echo get_term_link( _x('gallery', 'gallery category slug', 'thirdstyle'), 'category' ); ?>" title="<?php esc_attr_e( 'View posts in the Gallery category', 'thirdstyle' ); ?>"><?php _e( 'More Galleries', 'thirdstyle' ); ?></a>
  249.                 <span class="meta-sep">|</span>
  250.                 <span class="comments-link"><?php comments_popup_link( __( 'Ver comentários', 'thirdstyle' ), __( '1 Comment', 'thirdstyle' ), __( '% Comments', 'thirdstyle' ) ); ?></span>
  251.                 <?php edit_post_link( __( 'Edit', 'thirdstyle' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
  252.             </div><!-- .entry-utility -->
  253.         </div><!-- #post-## -->
  254.  
  255. <?php /* How to display posts in the asides category */ ?>
  256.  
  257.     <?php elseif ( in_category( _x('asides', 'asides category slug', 'thirdstyle') ) ) : ?>
  258.         <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  259.  
  260.         <?php if ( is_archive() || is_search() ) : // Display excerpts for archives and search. ?>
  261.             <div class="entry-summary">
  262.                 <?php the_excerpt(); ?>
  263.             </div><!-- .entry-summary -->
  264.         <?php else : ?>
  265.             <div class="entry-content">
  266.                 <?php the_content( __( 'Leia mais! <span class="meta-nav">→</span>', 'thirdstyle' ) ); ?>
  267.             </div><!-- .entry-content -->
  268.         <?php endif; ?>
  269.  
  270.             <div class="entry-utility">
  271.                 <?php thirdstyle_posted_on(); ?>
  272.                 <span class="meta-sep">|</span>
  273.                 <span class="comments-link"><?php comments_popup_link( __( 'Ver comentários', 'thirdstyle' ), __( '1 Comment', 'thirdstyle' ), __( '% Comments', 'thirdstyle' ) ); ?></span>
  274.                 <?php edit_post_link( __( 'Edit', 'thirdstyle' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
  275.             </div><!-- .entry-utility -->
  276.         </div><!-- #post-## -->
  277.  
  278. <?php /* How to display all other posts. */ ?>
  279.  
  280.     <?php else : ?>
  281.         <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  282.             <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( ' %s', 'thirdstyle' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  283.  
  284.             <div class="entry-meta">
  285.                 <?php thirdstyle_posted_on(); ?>
  286.             </div><!-- .entry-meta -->
  287.  
  288.     <?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
  289.             <div class="entry-summary">
  290.                 <?php the_excerpt(); ?>
  291.             </div><!-- .entry-summary -->
  292.     <?php else : ?>
  293.             <div class="entry-content">
  294.                 <?php the_content( __( 'Leia mais! <span class="meta-nav">→</span>', 'thirdstyle' ) ); ?>
  295.                 <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'thirdstyle' ), 'after' => '</div>' ) ); ?>
  296.             </div><!-- .entry-content -->
  297.     <?php endif; ?>
  298.  
  299.             <div class="entry-utility">
  300.                 <?php if ( count( get_the_category() ) ) : ?>
  301.                     <span class="cat-links">
  302.                         <?php printf( __( '<span class="%1$s">Marcadores:</span> %2$s', 'thirdstyle' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?>
  303.                     </span>
  304.                     <span class="meta-sep">|</span>
  305.                 <?php endif; ?>
  306.                 <?php
  307.                     $tags_list = get_the_tag_list( '', ', ' );
  308.                     if ( $tags_list ):
  309.                 ?>
  310.                     <span class="tag-links">
  311.                         <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'thirdstyle' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
  312.                     </span>
  313.                     <span class="meta-sep">|</span>
  314.                 <?php endif; ?>
  315.                 <span class="comments-link"><?php comments_popup_link( __( 'Ver comentários', 'thirdstyle' ), __( '1 Comment', 'thirdstyle' ), __( '% Comments', 'thirdstyle' ) ); ?></span>
  316.                 <?php edit_post_link( __( 'Edit', 'thirdstyle' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
  317.             </div><!-- .entry-utility -->
  318.         </div><!-- #post-## -->
  319.  
  320.         <?php comments_template( '', true ); ?>
  321.  
  322.     <?php endif; // This was the if statement that broke the loop into three parts based on categories. ?>
  323.  
  324. <?php endwhile; // End the loop. Whew. ?>
  325.  
  326. <?php if(!function_exists(‘wp_pagenavi’)) { wp_pagenavi(); } ?>
  327.  
  328. <?php /* Display navigation to next/previous pages when applicable */ ?>
  329.  
  330. <?php if (  $wp_query->max_num_pages > 1 ) : ?>
  331.                 <div id="nav-below" class="navigation">
  332.                     <div class="nav-previous"></div>
  333.                     <div class="nav-next"></div>
  334.                 </div><!-- #nav-below -->
  335. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement