Skip to content
This repository has been archived by the owner on Oct 17, 2018. It is now read-only.

Commit

Permalink
Merge pull request #58 from PHPSP/develop
Browse files Browse the repository at this point in the history
Post list widget
  • Loading branch information
williamespindola committed Jul 29, 2015
2 parents 5a2a56a + 7847c44 commit d3bd276
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 8 deletions.
2 changes: 1 addition & 1 deletion archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<?php endif; ?>

</div>
<div class="span4">
<div class="span4 right-column">
<?php if (is_active_sidebar('content-right-column-1')) : ?>
<?php dynamic_sidebar('content-right-column-1'); ?>
<?php endif; ?>
Expand Down
2 changes: 1 addition & 1 deletion author.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<?php endif; ?>

</div>
<div class="span4">
<div class="span4 right-column">
<?php if (is_active_sidebar('content-right-column-1')) : ?>
<?php dynamic_sidebar('content-right-column-1'); ?>
<?php endif; ?>
Expand Down
2 changes: 1 addition & 1 deletion category.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<div class="nav-previous">&nbsp;<?php previous_posts_link( '<< Página Anterior' ); ?></div>
<div class="nav-next">&nbsp;<?php next_posts_link( 'Próxima Página >>' ); ?></div>
</div>
<div class="span4">
<div class="span4 right-column">
<?php if (is_active_sidebar('content-right-column-1')) : ?>
<?php dynamic_sidebar('content-right-column-1'); ?>
<?php endif; ?>
Expand Down
2 changes: 1 addition & 1 deletion search.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<div class="nav-previous">&nbsp;<?php previous_posts_link( '<< Página Anterior' ); ?></div>
<div class="nav-next">&nbsp;<?php next_posts_link( 'Próxima Página >>' ); ?></div>
</div>
<div class="span4">
<div class="span4 right-column">
<?php if (is_active_sidebar('content-right-column-1')) : ?>
<?php dynamic_sidebar('content-right-column-1'); ?>
<?php endif; ?>
Expand Down
2 changes: 1 addition & 1 deletion single.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<?php endif; ?>
<?php comments_template(); ?>
</div>
<div class="span4">
<div class="span4 right-column">
<?php if (is_active_sidebar('content-right-column-1')) : ?>
<?php dynamic_sidebar('content-right-column-1'); ?>
<?php endif; ?>
Expand Down
21 changes: 21 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1536,4 +1536,25 @@ section.social div#twitter {
.footer_links a img {
max-width: 120px;
max-height: 40px;
}

.right-column div.article-phpsp-home-each {
margin-bottom: 6px;
}

.right-column div.article-phpsp-home-each-image {
width: 50px;
}

.right-column div.article-phpsp-home-each-image img {
width: 50px;
height: 50px;
}

.right-column div.todos_artigos {
margin-top: 14px;
}

.right-column div.todos_artigos a {
font-size: 13px;
}
2 changes: 1 addition & 1 deletion tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<div class="nav-previous">&nbsp;<?php previous_posts_link( '<< Página Anterior' ); ?></div>
<div class="nav-next">&nbsp;<?php next_posts_link( 'Próxima Página >>' ); ?></div>
</div>
<div class="span4">
<div class="span4 right-column">
<?php if (is_active_sidebar('content-right-column-1')) : ?>
<?php dynamic_sidebar('content-right-column-1'); ?>
<?php endif; ?>
Expand Down
4 changes: 2 additions & 2 deletions widget-artigos.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<div class="row-fluid article-phpsp-home">
<div class="span3">
<div class="row-fluid article-phpsp-home article-phpsp-home-each">
<div class="span3 article-phpsp-home-each-image">
<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'the-bootstrap_author_bio_avatar_size', 70 ) ); ?>
</div>
<div class="span9">
Expand Down
7 changes: 7 additions & 0 deletions widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ public function PHPSP_Artigos_Widget() {
}

public function widget( $args, $instance ) {
global $post;
$query_args = array( 'cat' => $instance['cat'], 'posts_per_page' => $instance['limit'] );

if (!is_home() && isset($post->ID) && is_numeric($post->ID))
{
$query_args['post__not_in'] = array($post->ID);
}

$loop = new WP_Query( $query_args );
echo $args['before_widget'];
echo $args['before_title'] . $instance['title'] . $args['after_title'];
Expand Down

0 comments on commit d3bd276

Please sign in to comment.