Exemplo n.º 1
0
    	</ul><!-- end wrapper ul -->
    </section><!-- end section -->
	<footer class="clear fl"> <!-- begin footer -->
		<?php 
actionBlock('pw_footer');
?>
	</footer> <!-- end footer -->
	<br class="clear" />
</div> <!-- end #body-wrapper -->
<?php 
actionCall('pw_body_bottom');
wp_footer();
?>
<!-- PressWork Framework created by c.bavota & Brendan Sera-Shriar - http://presswork.me -->
</body>
</html>
Exemplo n.º 2
0
?>
/admin/images/favicon.ico" />	

<?php 
if (is_singular() && get_option('thread_comments')) {
    wp_enqueue_script('comment-reply');
}
wp_enqueue_script('effects_js');
if (current_user_can('manage_options')) {
    wp_enqueue_style('farbtastic');
}
wp_head();
?>
</head>

<body <?php 
body_class();
?>
>
<?php 
actionCall('pw_body_top');
?>
<div id="body-wrapper">
    <header> <!-- begin header -->
		<?php 
actionBlock('pw_header');
?>
    </header> <!-- end header -->
    <section> <!-- begin section -->
	    <ul id="main-wrapper">
	
Exemplo n.º 3
0
    /**
     * 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;
        $defaults = array('width' => 'full', 'columns' => 1, 'posts' => 1, 'text' => 'excerpt', 'readmore' => 1, 'category' => 'all', 'dates' => 1, 'authors' => 1, 'comments' => 1, 'images' => 1, 'img_w' => 100, 'img_h' => 100, 'margin-right' => '', 'offset' => '', 'title' => '', 'id' => '', 'padding' => 15, 'colmargin' => 30);
        $r = wp_parse_args($args, $defaults);
        extract($r, EXTR_SKIP);
        $featuredcat = theme_option('fp_featured');
        $posts = array("posts_per_page" => $r['posts']);
        if ($r['category'] != "all") {
            $posts['cat'] = $r['category'];
        }
        if (isset($r['offset'])) {
            $posts['offset'] = $r['offset'];
        }
        $column = new WP_Query();
        $column->query($posts);
        if ($r['width'] == "full") {
            $width = ' style="width:100%; margin-right:' . $r['margin-right'] . 'px;"';
            if ($r['columns'] != 1) {
                $col_width = ($pw_content_width - $padding * 2 * $columns - $colmargin * ($columns - 1)) / $r['columns'];
            } else {
                $col_width = $pw_content_width - $padding * 2;
            }
            $col_width = ' style="width: ' . $col_width . 'px;';
        } else {
            $width = ' style="width:' . $r['width'] . 'px; margin-right:' . $r['margin-right'] . 'px;"';
            if ($r['columns'] != 1) {
                $col_width = ($r['width'] - $padding * 2 * $columns - $colmargin * ($columns - 1)) / $r['columns'];
            } else {
                $col_width = $r['width'] - $padding * 2;
            }
            $col_width = ' style="width: ' . $col_width . 'px;';
        }
        $x = 1;
        if (!empty($r['id'])) {
            $id = ' id="' . $r['id'] . '"';
        } else {
            $id = "";
        }
        ?>
		<div class="columns"<?php 
        echo $width;
        echo $id;
        ?>
>
		<?php 
        if (!empty($r['title'])) {
            echo '<div class="columns-title">' . $r['title'] . '</div>';
        }
        ?>
		<?php 
        while ($column->have_posts()) {
            $column->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;
            }
            ?>
			<div id="post-<?php 
            the_ID();
            ?>
" <?php 
            post_class($clear);
            echo $final_width;
            ?>
>
				<?php 
            actionBlock('pw_columns', $r);
            ?>
			</div>
		<?php 
            $x++;
        }
        ?>
		</div>
	<?php 
    }
Exemplo n.º 4
0
    ?>
    <article id="post-<?php 
    the_ID();
    ?>
" <?php 
    post_class();
    ?>
>
		<?php 
    if (is_category()) {
        actionBlock('pw_category_post');
    } elseif (is_author()) {
        actionBlock('pw_author_post');
    } elseif (is_archive()) {
        actionBlock('pw_archive_post');
    } elseif (is_search()) {
        actionBlock('pw_search_post');
    } elseif (is_page()) {
        actionBlock('pw_page_post');
    } elseif (is_single()) {
        actionBlock('pw_single_post');
    } else {
        actionBlock('pw_index_post');
    }
    ?>
    </article>
<?php 
}
if (is_home()) {
    echo '</div>';
}
Exemplo n.º 5
0
function pw_get_element($name)
{
    if ($name == "maincontent") {
        $handle = pw_handles('Main Content');
        ?>
	    <li id="maincontent"> <!-- begin maincontent -->
    	<?php 
        echo $handle;
        if (!have_posts()) {
            actionBlock('pw_404');
        } elseif (is_category()) {
            actionBlock('pw_category');
        } elseif (is_author()) {
            actionBlock('pw_author');
        } elseif (is_archive()) {
            actionBlock('pw_archive');
        } elseif (is_search()) {
            actionBlock('pw_search');
        } elseif (is_page()) {
            actionBlock('pw_page');
            comments_template('', true);
        } elseif (is_single()) {
            actionBlock('pw_single');
            comments_template('', true);
        } else {
            actionBlock('pw_index');
        }
        ?>
    	</li> <!-- end #maincontent -->
    	<?php 
    }
    if ($name == "firstsidebar") {
        pw_get_sidebar('firstsidebar', 'First Sidebar', 'pw_sidebar');
    }
    if ($name == "secondsidebar") {
        pw_get_sidebar('secondsidebar', 'Second Sidebar', 'pw_second_sidebar');
    }
    if ($name == "headerarea") {
        echo '<li id="headerarea" class="mainl">' . "\n";
        $handle = pw_handles('Widgetized Area', 'headerarea', true, 'header');
        echo $handle;
        if (!dynamic_sidebar("header-area")) {
            echo '<div class="warning clear fl"><p>' . __("Add widgets to the Header Area ", "presswork") . '<a href="' . admin_url('widgets.php') . '">' . __("here", "presswork") . '</a>.</p></div>';
        }
        echo '</li>' . "\n";
    }
    if ($name == "blogname") {
        $handle = pw_handles('Blog Name', 'blogname', true, 'header');
        ?>
	   	<li id="blogname" class="mainl">
            <?php 
        echo $handle;
        ?>
            <?php 
        if (is_home()) {
            $header = "h1";
        } else {
            $header = "div";
        }
        ?>
            <?php 
        echo "<" . $header;
        ?>
 class="siteheader"><a href="<?php 
        echo home_url();
        ?>
/"><?php 
        bloginfo('name');
        ?>
</a></<?php 
        echo $header;
        ?>
>
        </li>
		<?php 
    }
    if ($name == "header_logo") {
        $handle = pw_handles('Header Logo', 'header_logo', true, 'header');
        ?>
	   	<li id="header_logo" class="mainl">
            <?php 
        echo $handle;
        ?>
            <div class="siteheader"><a href="<?php 
        echo home_url();
        ?>
/"><img src="<?php 
        echo theme_option("header_logo");
        ?>
" alt="<?php 
        bloginfo("name");
        ?>
" /></a></div>
        </li>
		<?php 
    }
    if ($name == "description") {
        $handle = pw_handles('Description', 'description', true, 'header');
        ?>
	   	<li id="description" class="mainl">
            <?php 
        echo $handle;
        ?>
	   		<?php 
        bloginfo('description');
        ?>
    	</li>
		<?php 
    }
    if ($name == "nav") {
        $handle = pw_handles('Nav Menu', 'nav', true, 'header');
        if (function_exists('wp_nav_menu')) {
            echo '<li id="nav" class="mainl">';
            echo $handle;
            wp_nav_menu(array('theme_location' => 'main', 'menu_class' => 'sf-menu', 'sort_column' => 'menu_order', 'container' => 'nav', 'container_class' => 'clear fl', 'fallback_cb' => 'menu_default'));
            echo '</li>';
        }
    }
    if ($name == "subnav") {
        $handle = pw_handles('Sub Nav Menu', 'subnav', true, 'header');
        if (function_exists('wp_nav_menu')) {
            echo '<li id="subnav" class="mainl">';
            echo $handle;
            wp_nav_menu(array('theme_location' => 'sub', 'menu_class' => 'sf-menu', 'sort_column' => 'menu_order', 'container' => 'nav', 'container_class' => 'clear fl', 'fallback_cb' => 'sub_menu_default'));
            echo '</li>';
        }
    }
    if ($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;
            wp_nav_menu(array('theme_location' => 'footer', 'menu_class' => 'sf-menu', 'sort_column' => 'menu_order', 'container' => 'nav', 'container_class' => 'clear fl', 'fallback_cb' => 'footer_menu_default'));
            echo '</li>';
        }
    }
    if ($name == "extendedfooter") {
        $handle = pw_handles('Extended Footer', 'extendedfooter', true, 'footer');
        echo '<li id="extendedfooter" class="foot">';
        echo $handle;
        if (!dynamic_sidebar("extended-footer")) {
            echo '<div class="warning clear fl"><p>' . __("Add widgets to the Extended Footer ", "presswork") . '<a href="' . admin_url('widgets.php') . '">' . __("here", "presswork") . '</a>.</p></div>';
        }
        echo '</li>';
    }
    if ($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(__('&copy; %1$d %2$s. All Rights Reserved.', "presswork"), date('Y'), $link);
        echo ' ';
        printf(__('Built using %s.', "presswork"), '<a href="http://presswork.me">' . THEME_NAME . '</a>');
        echo '</li>';
    }
}