From ad79fdb064d0443cb4d826b5949539fdd8b42efb Mon Sep 17 00:00:00 2001
From: "c.bavota"
';
+ echo ' ';
printf(__("Add widgets to the Second Sidebar %shere%s", "presswork"), '', '');
- echo '
%2$s photo →.', 'This gallery contains %2$s photos →.', $total_images, "presswork" ),
+ %2$s photo →', 'This gallery contains %2$s photos →', $total_images, "presswork" ),
'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', "presswork" ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
number_format_i18n( $total_images )
); ?>
@@ -422,7 +475,7 @@ function pw_posts() {
$image_img_tag = wp_get_attachment_image( $image->ID, 'full' );
?>
- %2$s photo →.', 'This gallery contains %2$s photos →.', $total_images, "presswork" ),
+ %2$s photo →', 'This gallery contains %2$s photos →', $total_images, "presswork" ),
'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', "presswork" ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
number_format_i18n( $total_images )
); ?>
@@ -525,13 +578,11 @@ function pw_columns_post_title($r) {
%2$s photo.', 'This gallery contains %2$s photos.', $total_images, "presswork" ),
+ %2$s photo →', 'This gallery contains %2$s photos →', $total_images, "presswork" ),
'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', "presswork" ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
number_format_i18n( $total_images )
); ?>
@@ -577,11 +628,12 @@ function pw_columns_post_content($r) {
if($r['images']==1) {
if(function_exists('has_post_thumbnail') && has_post_thumbnail()) {
echo '';
- the_post_thumbnail(array($r['img_w'], $r['img_h']), array('class'=>'alignright'));
+ the_post_thumbnail(array($r['img_w'], $r['img_h']), array('class'=>$r['img_float']));
echo '';
}
}
the_excerpt();
+ if($r['readmore']==1) echo ''.__( 'Read more →', "presswork" ).'';
}
}
?>
@@ -590,11 +642,6 @@ function pw_columns_post_content($r) {
}
add_action('pw_columns_middle', 'pw_columns_post_content', 1, 1);
-function pw_columns_post_readmore($r) {
- if($r['readmore']==1) echo ''.__( 'Read more →', "presswork" ).'';
-}
-add_action('pw_columns_bottom', 'pw_columns_post_readmore', 1, 1);
-
// Including child theme action file
if(!defined('CHILD_ACTION_FILE'))
define('CHILD_ACTION_FILE', STYLESHEETPATH.'/actions.php');
diff --git a/presswork/admin/css/toolbox-styles.css b/presswork/admin/css/toolbox-styles.css
index c366be8..8e36ebb 100755
--- a/presswork/admin/css/toolbox-styles.css
+++ b/presswork/admin/css/toolbox-styles.css
@@ -581,6 +581,7 @@ div.handle {
z-index: 500;
color: #444;
font-size: 14px;
+ background: #f0f0f0;
}
#close-welcome:hover {
diff --git a/presswork/admin/inc/columns.php b/presswork/admin/inc/columns.php
index 375596f..4852f70 100755
--- a/presswork/admin/inc/columns.php
+++ b/presswork/admin/inc/columns.php
@@ -9,25 +9,27 @@
* @since PressWork 1.0
*/
function pw_columns($args = '') {
- global $pw_content_width;
+ global $pw_content_width, $paged;
+
$defaults = array(
'width' => 'full',
'columns' => 1,
'posts' => 1,
'text' => 'excerpt',
'readmore' => 1,
- 'category' => 'all',
+ 'category' => 0,
'dates' => 1,
'authors' => 1,
'comments' => 1,
'images' => 1,
'img_w' => 100,
'img_h' => 100,
- 'margin-right' => '',
+ 'img_float' => 'alignright',
+ 'margin_right' => '',
'offset' => '',
'title' => '',
'id' => '',
- 'padding' => 15,
+ 'padding' => 0,
'colmargin' => 30
);
@@ -35,45 +37,51 @@ function pw_columns($args = '') {
extract( $r, EXTR_SKIP );
$featuredcat = pw_theme_option('fp_featured');
- $posts = array(
+ $post_query = array(
"posts_per_page"=>$r['posts'],
+ "ignore_sticky_posts" => 1,
+ 'paged' => $paged
);
- if($r['category']!="all")
- $posts['cat'] = $r['category'];
-
- if(isset($r['offset']))
- $posts['offset'] = $r['offset'];
+ if($r['category']!=0)
+ $post_query['cat'] = $r['category'];
- $column = new WP_Query();
- $column->query($posts);
+ if(!empty($r['offset']))
+ $post_query['offset'] = $r['offset'];
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;';
+ $width = ' style="width:100%;';
+ if(!empty($r['margin_right'])) $width .= ' margin-right:'.$r['margin_right'].'px;"'; else $width .= '"';
+ if($r['columns']!=1) $col_width = ($pw_content_width - ($colmargin*($columns-1))) / $r['columns']; else $col_width = $pw_content_width;
} 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;';
+ $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);
+
?>
">
- '; _e("By", "presswork"); echo " "; the_author_posts_link(); echo ''; } ?>
-
-
@@ -559,7 +610,7 @@ function pw_columns_post_content($r) {
$image_img_tag = wp_get_attachment_image( $image->ID, 'full' );
?>
-