Before you ask please READ THIS

Show album category page

Hello, i would like to add a level to my portfolio and group albums by the "category album" taxonomy. To be more precise i want this kind of flow:

1) Portoflio page -> show the list of the category album taxonomy with photo (probably i need to add a photo plugin to the taxonomy)

2) clicking on one category i want to show the album belowing to that category (like going to "/category/fashion/" of the Scale Down Scroller theme) but using the album list layout. This behaviour is the same of clicking the filters in the album page but i don't want to use filters, i need a single page for every category.

3) clicking on the album use the actual album page


I tried to add a custom template in my child theme and get terms in this way:

$terms = array();

//albums
$category_template = defined( 'A13FRAMEWORK_ALBUM_GENRE_TEMPLATE' );

//prepare filter
$query_args = array(
'taxonomy' => A13FRAMEWORK_CPT_ALBUM_TAXONOMY,
'hide_empty' => true,
'parent' => 0,
);

if ( $category_template === true ) {
$term_slug = get_query_var( 'term' );
if ( ! empty( $term_slug ) ) {
$term_obj = get_term_by( 'slug', $term_slug,
A13FRAMEWORK_CPT_ALBUM_TAXONOMY );
$term_id = $term_obj->term_id;
$query_args['parent'] = $term_id;
}
}
$terms = get_terms( $query_args );

//Then pass it to the apolloframework function to print the album list
apollo13framework_display_items_from_query_album_list( $terms )

$terms variable works correctly but i but get an error from the apollo13framework_display_items_from_query_album_list($terms) function because it expects a WpQuery object and not an array. I couldn't get the taxonomy terms throught a WpQuery.

Please can you help me with this?

Thank you!

Stefano

Comments

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion