I'm setting up the Kalium theme for a client. I'm not sure if you can see their dev url, but it shouldn't be necessary. They are using the theme for a photo portfolio. We're using the visible titles layout, which is working fine. However, they want to change what the links for the image and category do. They want to show all sub-categories instead of all that categories (example - category 1 photos) images. So clicking on a category 1 photo would show all the subcategories for category 1.
I've dug through your theme for a while, and have narrowed it down to portfolio-loop-item-type-1-home.php and the function kalium_portfolio_get_category_link_home( ). I'm not able to find this or any other functions related to it in functions, actions or filters. Could you point me to the right code?
In order for you to view all subcategories when parent category is clicked, you need to assign parent category to the subcategory items, like shown in this screenshot:
thank you but this isn't what i wanted to do. I can't do what I want without editing the code. I've already read in other support areas that the feature I want isn't available in this release, but may be available in the future. I just want to know where the functions are in the code.
These are the features the client wants:
- Home page landing: menu lists categories - not subcategories. Portfolio images are samples from each category. Portfolio items should have category and subcategory listed under them. The images should NOT click through to the single page. In your example, it would be Photograph, Print, etc on the menu. The images would be Photography - Black and White, Print - Default, and on representative from each of the rest of the subcategories.
- When the user clicks category 1 or a portfolio item from category 1, they should be shown a layout with samples from each subcategory of Category 1. The menu should now say Category 1: Subcategory 1 Subcategory 2 etc. In your example, the menu would say only Black and White. The images shown would be a filter of all the subcategories of Photography (which is only Black and white).
The images should all say under them "Subcategory 1," or whatever their subcategory is. One representative for each subcategory should be shown. NOW if the user clicks on an image, from here they will see the portfolio Single page.
yes, you have it. The client wants another step before they are taken to the single portfolio page. They want to start with categories, then clicking will show another same-looking list with subcategories before you can click through to the single page.
On the home page we want to have the categories navigable by image, so for example, a category might be Clothing. When you click on that image, you would go to a page that looks just like the home page category navigation, except the pictures would be of the subcategories. So, you might see a picture of Dresses or Pants. Then you would click on that and go to the Portfolio page for that sub-category.
I thought I could make this change by editing the links that are created initially, on the home page.
I'm setting up the Kalium theme for a client. I'm not sure if you can see their dev url, but it shouldn't be necessary. They are using the theme for a photo portfolio. We're using the visible titles layout, which is working fine. However, they want to change what the links for the image and category do. They want to show all sub-categories instead of all that categories (example - category 1 photos) images. So clicking on a category 1 photo would show all the subcategories for category 1.
I've dug through your theme for a while, and have narrowed it down to portfolio-loop-item-type-1-home.php and the function kalium_portfolio_get_category_link_home( ). I'm not able to find this or any other functions related to it in functions, actions or filters. Could you point me to the right code?
Thanks!
Hi Lisa,
In order for you to view all subcategories when parent category is clicked, you need to assign parent category to the subcategory items, like shown in this screenshot:
(view large version)
And this one:
(view large version)
This way it will work for you.
Hi Arlind,
thank you but this isn't what i wanted to do. I can't do what I want without editing the code. I've already read in other support areas that the feature I want isn't available in this release, but may be available in the future. I just want to know where the functions are in the code.
These are the features the client wants:
- Home page landing: menu lists categories - not subcategories. Portfolio images are samples from each category. Portfolio items should have category and subcategory listed under them. The images should NOT click through to the single page. In your example, it would be Photograph, Print, etc on the menu. The images would be Photography - Black and White, Print - Default, and on representative from each of the rest of the subcategories.
- When the user clicks category 1 or a portfolio item from category 1, they should be shown a layout with samples from each subcategory of Category 1. The menu should now say Category 1: Subcategory 1 Subcategory 2 etc. In your example, the menu would say only Black and White. The images shown would be a filter of all the subcategories of Photography (which is only Black and white).
The images should all say under them "Subcategory 1," or whatever their subcategory is. One representative for each subcategory should be shown. NOW if the user clicks on an image, from here they will see the portfolio Single page.
Thanks,
Lisa Ziegler
Hi Lisa,
The file that shows category links is located here in this directory of the theme:
/wp-content/themes/kalium/tpls/portfolio-loop-item-categories.php
As I can understand you want to make the portfolio image link to category and not redirect to single portfolio page?
I am sorry for the confusions because I am still not able to understand what exactly you want to implement.
Hi Arlind,
yes, you have it. The client wants another step before they are taken to the single portfolio page. They want to start with categories, then clicking will show another same-looking list with subcategories before you can click through to the single page.
On the home page we want to have the categories navigable by image, so for example, a category might be Clothing. When you click on that image, you would go to a page that looks just like the home page category navigation, except the pictures would be of the subcategories. So, you might see a picture of Dresses or Pants. Then you would click on that and go to the Portfolio page for that sub-category.
I thought I could make this change by editing the links that are created initially, on the home page.
Thanks,
Lisa Ziegler
Hey Arlind,
I found it. Had to make a child theme, changed line 76 of portfolio-loop-item-type-1-home.php.
----------------------------------------- Changes
line 76. link for image is created with $term.
$term is set to subcategories, which we want for the menu but not the image.
---changed $term to $term -> parent
<a href="<?php echo esc_url( kalium_portfolio_get_category_link_home( $term -> parent ) ); ?>" class="item-link"<?php echo when_match( $portfolio_item_new_window, 'target="_blank"' ); ?>>
Also changed to add event to trigger change in category menu/list thingie above the portfolio images when clicking images.
NOW code on line 76 is
<a href="<?php echo esc_url( kalium_portfolio_get_category_link_home( $term -> parent ) ); ?>" class="item-link"<?php echo when_match( $portfolio_item_new_window, 'target="_blank"' ); ?> data-term="<?php echo esc_attr( $term->slug ); ?>">
(I'm doing a couple of other things to make it more like a store page, only showing one item of each category and one item of each subcategory. )
So no more help needed. But I thought I'd let you know in case anyone else asks in the future.
Thanks,
Lisa Ziegler
Hi Lisa,
Great to hear that you have managed to solved this.
Yeah its great that you have shared this solution, just in case somebody needs this, they already can see this ticket.
Enjoy using our theme.