Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add 'push' ability.

  • Loading branch information...
commit 17a3025b960824a5da5dad556bc16f74b4ce3050 1 parent 2d82e2a
@justintadlock authored
Showing with 18 additions and 6 deletions.
  1. +6 −3 columns.php
  2. +12 −3 css/columns.css
View
9 columns.php
@@ -110,7 +110,7 @@ public function enqueue_styles() {
'columns',
trailingslashit( plugin_dir_url( __FILE__ ) ) . "css/columns$suffix.css",
null,
- '20120914'
+ '20120915'
);
}
@@ -135,7 +135,7 @@ public function do_shortcode( $attr, $content = null ) {
$column_classes = array();
/* Set up the default arguments. */
- $defaults = apply_filters( 'column_shortcode_defaults', array( 'grid' => 10, 'span' => 1 ) );
+ $defaults = apply_filters( 'column_shortcode_defaults', array( 'grid' => 10, 'span' => 1, 'push' => 0 ) );
/* Parse the arguments. */
$attr = shortcode_atts( $defaults, $attr );
@@ -152,12 +152,15 @@ public function do_shortcode( $attr, $content = null ) {
/* Span cannot be greater than the grid. */
$attr['span'] = ( $attr['grid'] >= $attr['span'] ) ? absint( $attr['span'] ) : $attr['grid'];
+ $attr['push'] = ( $attr['grid'] > $attr['push'] ) ? absint( $attr['push'] ) : 0;
+
/* Add to the total $span. */
- $this->span = $this->span + $attr['span'];
+ $this->span = $this->span + $attr['span'] + $attr['push'];
/* Column classes. */
$column_classes[] = 'column';
$column_classes[] = "column-span-{$attr['span']}";
+ $column_classes[] = "column-push-{$attr['push']}";
/* If the $grid property is equal to 0. */
if ( 0 == $this->grid ) {
View
15 css/columns.css
@@ -1,7 +1,7 @@
/**
* CSS for handling the [column] shortcode styles.
*
- * @version 20120914
+ * @version 20120915
* @author Justin Tadlock <justin@justintadlock.com>
* @copyright Copyright (c) 2012, Justin Tadlock
* @link http://justintadlock.com
@@ -23,7 +23,6 @@
margin-right: 5%;
}
.column-first {
- margin-left: 0;
}
.column-last {
float: right;
@@ -78,4 +77,14 @@
.column-grid-10 .column-span-4 { width: 37%; }
.column-grid-10 .column-span-3 { width: 26.5%; }
.column-grid-10 .column-span-2 { width: 16%; }
-.column-grid-10 .column-span-1 { width: 5.5%; }
+.column-grid-10 .column-span-1 { width: 5.5%; }
+
+.column-grid-10 .column-push-9 { margin-left: 94.5%; }
+.column-grid-10 .column-push-8 { margin-left: 84%; }
+.column-grid-10 .column-push-7 { margin-left: 73.5%; }
+.column-grid-10 .column-push-6 { margin-left: 63%; }
+.column-grid-10 .column-push-5 { margin-left: 52.5%; }
+.column-grid-10 .column-push-4 { margin-left: 42%; }
+.column-grid-10 .column-push-3 { margin-left: 31.5%; }
+.column-grid-10 .column-push-2 { margin-left: 21%; }
+.column-grid-10 .column-push-1 { margin-left: 10.5%; }
Please sign in to comment.
Something went wrong with that request. Please try again.