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
Problem you try to solve is not easy. Your current approach relies on lot of magic, that just doesn't happen on its own ;-)
Points 2 & 3 are already done in theme, so we only need to focus on point 1.
However on your place I would go different route, as doing this from code level is beyond support power, and theme just don't have code that will solve this, so we would need to write lot of new code.
On your place I would do it like this:
1. Create new page that will list all your categories.
2. If you want to use scroller or slider to represent all your categories, then create new album, and its option enable Exclude from Albums list page http://rifetheme.com/apollo13-framework/docs/content-management/albums-works-post-types/album-options/
3. Add photos that will represent your categories, and for each photo set custom link http://rifetheme.com/apollo13-framework/docs/content-management/albums-works-post-types/album-media/ - this link should be link to category that it represent.
4. After you are done with preparing album that lists all categories add it with shortcode to page that you created in step 1. For Scroller use http://rifetheme.com/apollo13-framework/docs/content-management/shortcodes/scroller/
Sure this way you will have to update this album when you add new category, but trust me - it is best way for best result and visual effect :-)
With kind regards.