Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #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
    Nina

    #1034584

    Hey Advantage09,

    Can you show us what you’ve got so far?

    Best regards,
    Victoria

    #1035349

    Hi
    I have taken a print screen of how it look likes at the moment.
    https://www.landdesign.no/wp-content/uploads/2018/11/printscreen.png

    Regards
    Nina

    #1036910

    Hi,

    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,
    Ismael

    #1036980

    Thanks,

    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
    Nina

    #1037048

    Hi,

    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,
    Ismael

    #1042823

    Sorry 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
    Nina

    #1042908

    Hi,

    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,
    Ismael

    #1043036

    Temporary login detail below.

    #1043499

    Hi,

    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,
    Ismael

    #1043730

    Hi 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
    Nina

    #1045191

    Hi,

    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,
    Ismael

    #1045251

    Hi

    Any help with this would be appreciated.

    FTP detail below.

    Regards
    Nina

    #1046348

    Hi,

    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,
    Ismael

    #1046365

    This 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
    Nina

    #1047067

    Hi,

    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,
    Ismael

    #1047177

    Thank you so much, works great now.

    Great support as always:)

    You can close this topic.

    Regards
    Nina

    #1047547

    Hi Nina,

    Glad that we could help :)
    Thanks for using Enfold and have a great day!

    Best regards,
    Nikko

Viewing 18 posts - 1 through 18 (of 18 total)

The topic ‘Portfolio grid’ is closed to new replies.