<?php /** * The template for displaying the footer. * * Contains the closing of the #main-wrapper ul and the #body-wrapper div. * Includes all the action blocks for the footer. * * @since PressWork 1.0 */ ?> </ul> <!-- end #main-wrapper ul --> <footer id="footer-main" class="clearfix fl" role="contentinfo"> <!-- begin footer --> <?php pw_actionBlock('pw_footer'); ?> </footer> <!-- end footer --> </div> <!-- end #body-wrapper --> <?php pw_actionCall('pw_body_bottom'); wp_footer(); ?> <!-- PressWork framework created by c.bavota & Brendan Sera-Shriar - http://presswork.me --> </body> </html>
function pw_get_element($pw_add_name, $pw_add_class = null) { if ($pw_add_name == "maincontent") { $handle = pw_handles('Main Content'); ?> <li id="maincontent" role="main"<?php if (!empty($class)) { echo ' class="' . $pw_add_class . '"'; } ?> > <!-- begin maincontent --> <?php echo $handle; if (!have_posts()) { pw_actionBlock('pw_404'); } elseif (is_category()) { pw_actionBlock('pw_category'); } elseif (is_author()) { pw_actionBlock('pw_author'); } elseif (is_archive()) { pw_actionBlock('pw_archive'); } elseif (is_search()) { pw_actionBlock('pw_search'); } elseif (is_page()) { pw_actionBlock('pw_page'); comments_template('', true); } elseif (is_single()) { pw_actionBlock('pw_single'); comments_template('', true); } else { pw_actionBlock('pw_index'); } ?> </li> <!-- end #maincontent --> <?php } if ($pw_add_name == "firstsidebar") { pw_get_sidebar('firstsidebar', 'First Sidebar', 'pw_sidebar', $pw_add_class); } if ($pw_add_name == "secondsidebar") { pw_get_sidebar('secondsidebar', 'Second Sidebar', 'pw_second_sidebar', $pw_add_class); } if ($pw_add_name == "headerarea") { echo '<li id="headerarea" class="mainl" role="complementary">' . "\n"; $handle = pw_handles('Widgetized Area', 'headerarea', true, 'header'); echo $handle; if (!dynamic_sidebar("header-area") && current_user_can('edit_theme_options')) { echo '<div class="warning clear fl"><p>'; printf(__("Add widgets to the Header Area %shere%s", "presswork"), '<a href="' . admin_url('widgets.php') . '">', '</a>'); echo '</p></div>'; } echo '</li>' . "\n"; } if ($pw_add_name == "blogname") { $handle = pw_handles('Blog Name', 'blogname', true, 'header'); ?> <li id="blogname" class="mainl"> <?php echo $handle; ?> <h1 id="site-title" class="siteheader"><a href="<?php echo home_url(); ?> /"><?php bloginfo('name'); ?> </a></h1> </li> <?php } if ($pw_add_name == "header_logo") { $handle = pw_handles('Header Logo', 'header_logo', true, 'header'); $logo = pw_theme_option("header_logo"); if (!empty($logo)) { ?> <li id="header_logo" class="mainl"> <?php echo $handle; ?> <div id="site-logo" class="siteheader"><h1><?php bloginfo('name'); ?> </h1><a href="<?php echo home_url(); ?> /"><img src="<?php echo $logo; ?> " alt="<?php bloginfo("name"); ?> " /></a></div> </li> <?php } } if ($pw_add_name == "header_image") { $handle = pw_handles('Header Image', 'header_image', true, 'header'); ?> <li id="header_image" class="mainl"><?php echo $handle; ?> </li> <?php } if ($pw_add_name == "description") { $handle = pw_handles('Description', 'description', true, 'header'); ?> <li id="description" class="mainl"> <?php echo $handle; ?> <?php bloginfo('description'); ?> </li> <?php } if ($pw_add_name == "nav") { $handle = pw_handles('Primary Nav Menu', 'nav', true, 'header'); if (function_exists('wp_nav_menu')) { echo '<li id="nav" class="mainl">'; echo $handle; echo '<nav class="clear fl" role="navigation">'; echo '<h3 class="assistive-text">Main menu</h3>'; wp_nav_menu(array('theme_location' => 'primary', 'sort_column' => 'menu_order', 'container' => '', 'fallback_cb' => 'pw_menu_default')); echo '</nav>'; echo '</li>'; } } if ($pw_add_name == "subnav") { $handle = pw_handles('Secondary Nav Menu', 'subnav', true, 'header'); if (function_exists('wp_nav_menu')) { echo '<li id="subnav" class="mainl">'; echo $handle; echo '<nav class="clear fl" role="navigation">'; echo '<h3 class="assistive-text">Sub menu</h3>'; wp_nav_menu(array('theme_location' => 'secondary', 'sort_column' => 'menu_order', 'container' => '', 'fallback_cb' => 'pw_sub_menu_default')); echo '</nav>'; echo '</li>'; } } if ($pw_add_name == "footernav") { $handle = pw_handles('Footer Nav Menu', 'footernav', true, 'footer'); if (function_exists('wp_nav_menu')) { echo '<li id="footernav" class="foot">'; echo $handle; echo '<nav class="clear fl" role="navigation">'; echo '<h3 class="assistive-text">Footer menu</h3>'; wp_nav_menu(array('theme_location' => 'footer', 'sort_column' => 'menu_order', 'container' => '', 'fallback_cb' => 'pw_footer_menu_default')); echo '</nav>'; echo '</li>'; } } if ($pw_add_name == "extendedfooter") { $handle = pw_handles('Extended Footer', 'extendedfooter', true, 'footer'); echo '<li id="extendedfooter" class="foot" role="complementary">'; echo $handle; if (!dynamic_sidebar("extended-footer") && current_user_can('edit_theme_options')) { echo '<div class="warning clear fl"><p>'; printf(__("Add widgets to the Extended Footer %shere%s", "presswork"), '<a href="' . admin_url('widgets.php') . '">', '</a>'); echo '</p></div>'; } echo '</li>'; } if ($pw_add_name == "copyright") { $handle = pw_handles('Copyright', 'copyright', true, 'footer'); echo '<li id="copyright" class="foot">'; echo $handle; $link = '<a href="' . home_url() . '">' . get_bloginfo('name') . '</a>'; printf(__('© %1$d %2$s. All Rights Reserved.', "presswork"), date('Y'), $link); echo ' '; printf(__('Created using %s.', "presswork"), '<a href="http://presswork.me">PressWork</a>'); echo '</li>'; } do_action('add_pw_get_element', $pw_add_name, $pw_add_class); }
?> <article id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <?php if (is_category()) { pw_actionBlock('pw_category_post'); } elseif (is_author()) { pw_actionBlock('pw_author_post'); } elseif (is_archive()) { pw_actionBlock('pw_archive_post'); } elseif (is_search()) { pw_actionBlock('pw_search_post'); } elseif (is_page()) { pw_actionBlock('pw_page_post'); } elseif (is_single()) { pw_actionBlock('pw_single_post'); } else { pw_actionBlock('pw_index_post'); } ?> </article> <?php } if (is_home()) { echo '</div>'; }
function pw_home_page_featured_query() { global $post, $notin, $paged, $pw; $pw = 1; $sticky = get_option('sticky_posts'); $notin = pw_notin(); if (!empty($sticky)) { if (!empty($notin)) { $notin = array_merge($notin, $sticky); } else { $notin = $sticky; } if ($paged < 2) { $args = array('post__in' => $sticky, 'ignore_sticky_posts' => 1); $the_query = new WP_Query($args); while ($the_query->have_posts()) { $the_query->the_post(); ?> <article id="post-<?php the_ID(); ?> " <?php post_class("pw pw" . $pw); ?> > <?php pw_actionBlock('pw_index_sticky_post'); ?> </article> <?php $pw++; } wp_reset_query(); } } else { $args = array('post__not_in' => $notin, 'posts_per_page' => 2); $the_query = new WP_Query($args); while ($the_query->have_posts()) { $the_query->the_post(); if ($paged < 2) { $notin[] = $post->ID; ?> <article id="post-<?php the_ID(); ?> " <?php post_class("pw pw" . $pw); ?> > <?php pw_actionBlock('pw_index_featured_post'); ?> </article> <?php $pw++; } else { $notin[] = $post->ID; } } wp_reset_query(); } query_posts(array('post__not_in' => $notin, "paged" => $paged)); }
body_class("ie6"); ?> > <![endif]--> <!--[if IE 7 ]> <body <?php body_class("ie7"); ?> > <![endif]--> <!--[if IE 8 ]> <body <?php body_class("ie8"); ?> > <![endif]--> <!--[if IE 9 ]> <body <?php body_class("ie9"); ?> > <![endif<]--> <!--[if (gt IE 9)|!(IE)]><!--> <body <?php body_class(); ?> > <!--<![endif]--> <?php pw_actionCall('pw_body_top'); ?> <div id="body-wrapper" class="clearfix"> <header id="header-main" role="banner"> <!-- begin header --> <?php pw_actionBlock('pw_header'); ?> </header> <!-- end header --> <ul id="main-wrapper">
/** * Add pw_columns functionality * * Display posts in a grid layout according to the parameters set in the * argument array. * * @since PressWork 1.0 */ function pw_columns($args = '') { global $pw_content_width, $paged; $defaults = array('width' => 'full', 'columns' => 1, 'posts' => 1, 'text' => 'excerpt', 'excerpt_length' => 55, 'readmore' => 1, 'category' => 0, 'dates' => 1, 'authors' => 1, 'comments' => 1, 'images' => 1, 'img_w' => 100, 'img_h' => 100, 'img_float' => 'alignright', 'margin_right' => '', 'offset' => '', 'title' => '', 'id' => '', 'padding' => 0, 'colmargin' => 30, 'container_width' => ''); $r = wp_parse_args($args, $defaults); extract($r, EXTR_SKIP); $content_width = empty($r['container_width']) ? $pw_content_width : $r['container_width']; $featuredcat = pw_theme_option('fp_featured'); $post_query = array("posts_per_page" => $r['posts'], "ignore_sticky_posts" => 1, 'paged' => $paged); if ($r['category'] != 0) { $post_query['cat'] = $r['category']; } if (!empty($r['offset'])) { $post_query['offset'] = $r['offset']; } if ($r['width'] == "full") { $width = ' style="width:100%;'; if (!empty($r['margin_right'])) { $width .= ' margin-right:' . $r['margin_right'] . 'px;"'; } else { $width .= '"'; } if ($r['columns'] != 1) { $col_width = ($content_width - $colmargin * ($columns - 1)) / $r['columns']; $col_width = ' style="width: ' . $col_width . 'px;'; } else { $col_width = ' style="width: 100%'; } } else { $width = ' style="width:' . $r['width'] . 'px; margin-right:' . $r['margin_right'] . 'px;"'; if ($r['columns'] != 1) { $col_width = ($r['width'] - $colmargin * ($columns - 1)) / $r['columns']; } else { $col_width = $r['width']; } $col_width = ' style="width: ' . $col_width . 'px;'; } if (!empty($padding)) { $col_width .= ' padding: ' . $padding . 'px;'; } $x = 1; if (!empty($r['id'])) { $id = ' id="' . $r['id'] . '"'; } else { $id = ""; } $column_query = new WP_Query(); $column_query->query($post_query); ?> <div class="columns"<?php echo $width; echo $id; ?> > <?php while ($column_query->have_posts()) { $column_query->the_post(); ?> <?php if ($x == 1) { $clear = "clear"; } else { $clear = ""; } ?> <?php if ($x != 1 && $r['columns'] > 1) { $final_width = $col_width . ' margin-left: ' . $colmargin . 'px;"'; } else { $final_width = $col_width . '"'; } ?> <?php if ($x == $r['columns']) { $x = 0; } ?> <article id="post-<?php the_ID(); ?> " <?php post_class($clear); echo $final_width; ?> > <?php pw_actionBlock('pw_columns', $r); ?> </article> <?php $x++; } ?> </div> <?php }