hello my site is
snowsanta.com
ALL/Film/IMC/ is my portfolio category
when i clicked on 'film' in the category i couldn't see anything
but 'IMC' was OK
then, i clicked on tne 'page', and it went back to 'all' in the category.
what should i do?
hello my site is
snowsanta.com
ALL/Film/IMC/ is my portfolio category
when i clicked on 'film' in the category i couldn't see anything
but 'IMC' was OK
then, i clicked on tne 'page', and it went back to 'all' in the category.
what should i do?
The portfolio/category filter will not work properly if you use the pagination feature because the filter can't sort/filter items across pages. Eg on this page: http://snowsanta.com/?paged=2 the "film" filter will display some items. If you want to make sure that the filter function takes all items into account deactivate the portfolio pagination and display all items on one page.
so how can i solve this problem?
or use the 'plug-in'?
Hi,
Like Dude said, disable the "Portfolio pagination" to show all portfolio items. Filtering will only show the items on a specific category if they exist on that page.
Regards,
Ismael
I looked into it and the only "solution" I can provide is a php code snippet which removes empty or "unnecessary" categories from the current portfolio page. Thus the portfolio will only show categories which will display one or more entries if you click on the link. Open up includes/loop-portfolio.php and replace following lines:
$categories = get_categories($args);
$container_id = "";
with:
$categories = get_categories($args);
$container_id = "";
$current_page_cats = array();
while (have_posts()){
the_post();
$current_item_cats = get_the_terms( $id, 'portfolio_entries' );
if(!empty($current_item_cats))
{
foreach($current_item_cats as $current_item_cat)
{
$current_page_cats[] = $current_item_cat->term_id;
}
}
}
$current_page_cats = array_unique($current_page_cats);
and:
$output .= "<span class='text-sep ".$category->category_nicename."_sort_sep'>/</span><a href='#' data-filter='".$category->category_nicename."_sort' class='".$category->category_nicename."_sort_button' >".$category->cat_name."</a>";
$container_id .= $category->term_id;
with:
if(in_array($category->term_id, $current_page_cats, true))
{
$output .= "<span class='text-sep ".$category->category_nicename."_sort_sep'>/</span><a href='#' data-filter='".$category->category_nicename."_sort' class='".$category->category_nicename."_sort_button' >".$category->cat_name."</a>";
$container_id .= $category->term_id;
}You must log in to post.