From bb2f2cca29f0a8d85e7385afc64c721fa94cb377 Mon Sep 17 00:00:00 2001 From: Ben Keith Date: Fri, 5 Feb 2016 17:12:35 -0500 Subject: [PATCH 1/2] Add rounduplink partials, use the largo_partial_by_post_type filters in category and generic archives. --- archive.php | 5 ++++- category.php | 3 +++ partials/content-rounduplink.php | 25 +++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 partials/content-rounduplink.php diff --git a/archive.php b/archive.php index 87a9dc801..3426e1876 100644 --- a/archive.php +++ b/archive.php @@ -4,6 +4,7 @@ * * @package Largo * @since 0.1 + * @filter largo_partial_by_post_type */ get_header(); $queried_object = get_queried_object(); @@ -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' ); diff --git a/category.php b/category.php index 9b40f4424..f866a9cca 100644 --- a/category.php +++ b/category.php @@ -4,6 +4,7 @@ * * @package Largo * @since 0.4 + * @filter largo_partial_by_post_type */ get_header(); @@ -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' ); diff --git a/partials/content-rounduplink.php b/partials/content-rounduplink.php new file mode 100644 index 000000000..0ad4acf5b --- /dev/null +++ b/partials/content-rounduplink.php @@ -0,0 +1,25 @@ +ID); ?> + +
> +
+

' . get_the_title() . '' : get_the_title(); ?>

+
+ +
+ '; + echo $custom['lr_desc'][0]; + echo '

'; + } + if ( isset($custom['lr_source'][0] ) ) { + echo '

' . __('Source: ', 'argo-links') . ''; + echo ( isset( $custom['lr_url'][0] ) ) ? '' . $custom['lr_source'][0] . '' : $custom['lr_source'][0]; + echo '

'; + } + ?> +

Posted on:

+
+
+ + From 6d300c8fd4ef90ed51449a19110faf80bd0321c8 Mon Sep 17 00:00:00 2001 From: Ben Keith Date: Fri, 5 Feb 2016 17:33:23 -0500 Subject: [PATCH 2/2] Add content-roundup.php, and some edits to content-rounduplink.php --- partials/content-roundup.php | 37 ++++++++++++++++++++++++++++++++ partials/content-rounduplink.php | 13 ++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 partials/content-roundup.php diff --git a/partials/content-roundup.php b/partials/content-roundup.php new file mode 100644 index 000000000..365504b6a --- /dev/null +++ b/partials/content-roundup.php @@ -0,0 +1,37 @@ +ID, FALSE ); +$values = get_post_custom( $post->ID ); +$featured = has_term( 'homepage-featured', 'prominence' ); +?> +
> + + '; + + if ( largo_has_categories_or_tags() && $tags === 'top' ) { + echo '
' . largo_top_term( $args = array( 'echo' => FALSE ) ) . '
'; + } + ?> + +

+ +

+ + + + + + + +
diff --git a/partials/content-rounduplink.php b/partials/content-rounduplink.php index 0ad4acf5b..e21f3ad08 100644 --- a/partials/content-rounduplink.php +++ b/partials/content-rounduplink.php @@ -1,4 +1,15 @@ -ID); ?> +ID); +?>
>