Tagged: portfolio grid
-
AuthorPosts
-
November 15, 2018 at 3:21 am #1033754
Hi, I am trying to adjust the portfolio grid. My client want to show category and subcategory in the portfolio grid but also show title and excerpt.
The grid would then have an image, below the image is category and subcategory, then title and excerpt, is there a way this can be done?It should look something like this page: https://en.nordlandturselskap.no/activities/
Regards
NinaNovember 16, 2018 at 8:35 pm #1034584Hey Advantage09,
Can you show us what you’ve got so far?
Best regards,
VictoriaNovember 19, 2018 at 10:42 pm #1035349Hi
I have taken a print screen of how it look likes at the moment.
https://www.landdesign.no/wp-content/uploads/2018/11/printscreen.pngRegards
NinaNovember 23, 2018 at 10:43 am #1036910Hi,
Thanks for the update.
Yes, this is possible but you have to modify the config-templatebuilder > aviashortcodes > portfolio > portfolio.php file directly. Add this code right before line 668:
$categories = get_the_terms($the_id, 'portfolio_entries'); $separator = ', '; $count = count($categories); $i = 0; $output_cat = "<div class'portfolio-categories'>"; if ( ! empty( $categories ) ) { foreach( $categories as $category ) { if($i++ === $count) { $separator = ''; } $output_cat .= '<span alt="' . esc_attr( sprintf( __( 'View all posts in %s', 'textdomain' ), $category->name ) ) . '">' . esc_html( $category->name ) . '</span>' . $separator; } } $output_cat .= "</div>"; $output .= $cat;
Best regards,
IsmaelNovember 23, 2018 at 3:57 pm #1036980Thanks,
but putting this code just before line 668 broke the entire page. I tried a few variations but no luck. I also tried to copy the page over to my child theme and paste the code.
Regards
NinaNovember 23, 2018 at 6:20 pm #1037048Hi,
It’s working on my installation. Did you copy it from your email? Please copy it directly from this forum. Let us know if it’s still not working.
Best regards,
IsmaelDecember 9, 2018 at 10:30 pm #1042823Sorry for late reply.
Still not working on my end. Including a link to an image of the page in question, putting a red line at line 668. Is this where to put your code?
Regards
NinaDecember 10, 2018 at 5:50 am #1042908Hi,
I think you forgot to include the screenshot. Please post the login details in the private field. Make sure that the Appearance > Editor panel is accessible so that we can test the modification.
Best regards,
IsmaelDecember 10, 2018 at 1:12 pm #1043036Temporary login detail below.
December 11, 2018 at 2:23 am #1043499Hi,
Thanks for the update. Are you trying to override the shortcode in your child theme? You have to add this filter first.
// https://kriesi.at/documentation/enfold/intro-to-layout-builder/#add-elements-to-alb
Create a folder called “shortcodes” and then create a copy of the “portfolio” files there. You don’t need to copy the whole “config-templatebuilder” directory.
Best regards,
IsmaelDecember 11, 2018 at 12:57 pm #1043730Hi Ismael
Not sure what you are asking? I want to add category and subcategory to portfolio items so that people can make the distinction between type of activity the want to look at. After the title I want Catergory and subcategory to appear.
If you look at this page https://en.nordlandturselskap.no/activities/ – If you look at the canoe trip to the right where it says activity and below easy 4-6 h. Activity would be the category and easy 4-6 h would be the subcategory.
The code you provided to put in right after line 668 in the portfolio.php file just broke the site.
Not sure where to go from here. So I am not really sure if I am trying to override any shortcodes or not? Creating a folder called shortcodes or copying the config-template builder directory would not really impact where to put the code, would it?
Regards
NinaDecember 14, 2018 at 10:41 am #1045191Hi,
Ok. Let’s start from scratch. In order to override a shortcode in your child theme, you have to put this filter first.
// https://kriesi.at/documentation/enfold/intro-to-layout-builder/#add-elements-to-alb
After adding that filter, create a folder called “shortcodes”, copy the “portfolio” shortcode files inside, the whole directory, and then add the modification there. Let us know if it’s still confusing.
Or post the FTP details in the private field so that we can add the modification.
Best regards,
IsmaelDecember 14, 2018 at 2:03 pm #1045251Hi
Any help with this would be appreciated.
FTP detail below.
Regards
NinaDecember 17, 2018 at 4:01 pm #1046348Hi,
I added the modification but it’s only displaying a single category called “Aktiviter”. Are there any other categories?
Screenshot: https://imgur.com/a/X8ah4b9
Best regards,
IsmaelDecember 17, 2018 at 4:29 pm #1046365This looks almost right. The categories displays correctly as far as I can see. There are two categories and they both display correctly.
But, I just added a subcategory and now this displays first, before the main category and also, is it possible to get category and subcategory on two lines? And remove the , comma behind Aktiviteter and Bedrifter og grupper.
Link to how it looks now: https://www.bergtikjin.no/aktiviteter/
Almost there, thank you.
Regards
NinaDecember 19, 2018 at 1:38 am #1047067Hi,
I modified the code a bit to separate the sub categories from their parent category. If you want to change the style of the categories, use this:
.grid-entry-categories { font-size: 16px; color: orange; } /* child categories */ .grid-entry-categories .child { font-size: 15px; color: red; }
Best regards,
IsmaelDecember 19, 2018 at 1:32 pm #1047177Thank you so much, works great now.
Great support as always:)
You can close this topic.
Regards
NinaDecember 20, 2018 at 2:05 am #1047547Hi Nina,
Glad that we could help :)
Thanks for using Enfold and have a great day!Best regards,
Nikko -
AuthorPosts
- The topic ‘Portfolio grid’ is closed to new replies.