Skip to content

Commit

Permalink
Merge pull request #842 from INN/782-Largo_Related-before
Browse files Browse the repository at this point in the history
Largo_Related tests and bugfixes
  • Loading branch information
rnagle committed Aug 17, 2015
2 parents 6cbbc9d + 1037d67 commit bf748ac
Show file tree
Hide file tree
Showing 2 changed files with 350 additions and 12 deletions.
8 changes: 6 additions & 2 deletions inc/related-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ protected function cleanup_ids() {
* Fetches posts contained within the series(es) this post resides in. Feeds them into $this->post_ids array
*
* @access protected
* @see largo_series_custom_order
*/
protected function get_series_posts() {

Expand Down Expand Up @@ -488,7 +489,9 @@ protected function get_series_posts() {
// see if there's a post that has the sort order info for this series
$cftl_query = new WP_Query( array(
'post_type' => 'cftl-tax-landing',
'series' => $term->slug,
'tax_query' => array (
'series' => $term->slug,
),
'posts_per_page' => 1
));

Expand All @@ -500,12 +503,13 @@ protected function get_series_posts() {
case 'ASC':
$args['order'] = 'ASC';
break;
// 'series_custom' and 'featured' are custom ones, caught with largo_series_custom_order in inc/wp-taxonomy-landing/functions/cftl-series-order.php
case 'custom':
$args['orderby'] = 'series_custom';
break;
case 'featured, DESC':
case 'featured, ASC':
$args['orderby'] = $opt['post_order'];
$args['orderby'] = $has_order;
break;
}
}
Expand Down
Loading

0 comments on commit bf748ac

Please sign in to comment.