Skip to content

Commit

Permalink
Merge pull request #1122 from INN/WE-90-better-link-roundups-support
Browse files Browse the repository at this point in the history
Improve support for Link Roundups in archives
  • Loading branch information
aschweigert committed Feb 7, 2016
2 parents 01a0386 + 6d300c8 commit 773796f
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 1 deletion.
5 changes: 4 additions & 1 deletion archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*
* @package Largo
* @since 0.1
* @filter largo_partial_by_post_type
*/
get_header();
$queried_object = get_queried_object();
Expand Down Expand Up @@ -86,7 +87,9 @@
rewind_posts();

while ( have_posts() ) : the_post();
get_template_part( 'partials/content', 'archive' );
$post_type = get_post_type();
$partial = largo_get_partial_by_post_type('archive', $post_type, 'archive');
get_template_part( 'partials/content', $partial );
endwhile;

largo_content_nav( 'nav-below' );
Expand Down
3 changes: 3 additions & 0 deletions category.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*
* @package Largo
* @since 0.4
* @filter largo_partial_by_post_type
*/
get_header();

Expand Down Expand Up @@ -67,6 +68,8 @@
while ( have_posts() ) {
the_post();
//$shown_ids[] = get_the_ID();
$post_type = get_post_type();
$partial = largo_get_partial_by_post_type('archive', $post_type, 'archive');
get_template_part( 'partials/content', 'archive' );
}
largo_content_nav( 'nav-below' );
Expand Down
37 changes: 37 additions & 0 deletions partials/content-roundup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
/*
* The template for displaying posts from the Roundup post type from INN/link-roundups
*
* @package Largo
* @since 0.5.4
* @link https://github.com/INN/link-roundups
* @link https://wordpress.org/plugins/link-roundups/
*/
$tags = of_get_option( 'tag_display' );
$hero_class = largo_hero_class( $post->ID, FALSE );
$values = get_post_custom( $post->ID );
$featured = has_term( 'homepage-featured', 'prominence' );
?>
<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?>>

<?php
// Special treatment for posts that are in the Homepage Featured prominence taxonomy term and have thumbnails or videos.
$entry_classes = 'entry-content';
echo '<div class="' . $entry_classes . '">';

if ( largo_has_categories_or_tags() && $tags === 'top' ) {
echo '<h5 class="top-tag">' . largo_top_term( $args = array( 'echo' => FALSE ) ) . '</h5>';
}
?>

<h2 class="entry-title">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute( array( 'before' => __( 'Permalink to', 'largo' ) . ' ' ) )?>" rel="bookmark"><?php the_title(); ?></a>
</h2>

<h5 class="byline visuallyhidden"><?php largo_byline(); ?></h5>

<?php the_content(); ?>

</div><!-- .entry-content -->

</article><!-- #post-<?php the_ID(); ?> -->
36 changes: 36 additions & 0 deletions partials/content-rounduplink.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/*
* The template for displaying posts from the Roundup Link post type from INN/link-roundups
*
* @package Largo
* @since 0.5.4
* @link https://github.com/INN/link-roundups
* @link https://wordpress.org/plugins/link-roundups/
*/

$custom = get_post_custom($post->ID);
?>

<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?>>
<header>
<h2 class="entry-title"><?php echo ( isset( $custom['lr_url'][0] ) ) ? '<a href="' . $custom['lr_url'][0] . '">' . get_the_title() . '</a>' : get_the_title(); ?></h2>
</header>

<div class="entry-content">
<?php
if ( isset( $custom['lr_desc'][0] ) ) {
echo '<p class="description">';
echo $custom['lr_desc'][0];
echo '</p>';
}
if ( isset($custom['lr_source'][0] ) ) {
echo '<p class="source">' . __('Source: ', 'argo-links') . '<span>';
echo ( isset( $custom['lr_url'][0] ) ) ? '<a href="' . $custom['lr_url'][0] . '">' . $custom['lr_source'][0] . '</a>' : $custom['lr_source'][0];
echo '</span></p>';
}
?>
<p class="posted-on">Posted on: <?php the_time('F j, Y') ?></p>
</div>
</article> <!-- /.post-lead -->


0 comments on commit 773796f

Please sign in to comment.