Permalink
Browse files

clean portfolio view. fixed portfolio pagination.

  • Loading branch information...
1 parent ee8e5de commit f23a90ae802f24216b6e2b9b6047fe58d311a3af @fusepilot committed Jan 30, 2012
@@ -16,4 +16,6 @@ function create_post_type() {
);
}
+add_rewrite_rule( 'work/page/([0-9]+)/?$', 'index.php?pagename=work&paged=$matches[1]', 'top' );
+
?>
@@ -2,17 +2,39 @@
/*
Template Name: Portfolio
*/
+
?>
<?php get_header(); ?>
<?php get_sidebar(); ?>
+<?php
+
+$style = $_GET['style'];
+
+c($paged);
+
+$args = array('post_type'=> 'project', 'paged'=>$paged);
+
+$order_by = $_GET['order_by'];
+if(!empty($order_by)) {
+ $args['orderby'] = $order_by;
+};
+
+if($style == 'masonry' || empty($style)) {
+ $args['posts_per_page'] = -1;
+};
+
+query_posts($args);
+
+?>
+
<section id="content" class="index">
<?php
- $params = $_GET;
- $urls['masonry'] = get_permalink() . '?' . http_build_query( array_merge($params, array('style' => 'masonry')) );
- $urls['list'] = get_permalink() . '?' . http_build_query( array_merge($params, array('style' => 'list')) );
+
+ $urls['masonry'] = get_permalink() . '?' . http_build_query( array_merge($_GET, array('style' => 'masonry')) );
+ $urls['list'] = get_permalink() . '?' . http_build_query( array_merge($_GET, array('style' => 'list')) );
//$urls['name'] = get_permalink() . '?' . http_build_query( array_merge($params, array('order_by' => 'title')) );
//$urls['date'] = get_permalink() . '?' . http_build_query( array_merge($params, array('order_by' => 'date')) );
?>
@@ -32,21 +54,7 @@
<?php endif; ?>
- <?php
- $style = $_GET['style'];
-
- $args = array('post_type'=> 'project', 'paged'=>$paged);
-
- $order_by = $_GET['order_by'];
- if(!empty($order_by)) {
- $args['orderby'] = $order_by;
- };
-
- if($style == 'masonry' || empty($style)) {
- $args['posts_per_page'] = -1;
- };
-
- query_posts($args);
+ <?php
switch($style) {
case 'masonry':

0 comments on commit f23a90a

Please sign in to comment.