Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1297329
    STEVE H
    Participant

    Hi,

    I would like to display the category on portfolio items in the Renew theme. I have seen discussions of this on the forum but I think they are outdated. I have a child theme set up, but there are no files in the folder yet. Can you tell me what file needs to be created, where it needs to be located in the folder directory, and how the code should be set up? (The site is under construction and in maintenance mode, so I will need to give you the login info if you need to look into this.)

    site: watermarkarts.org
    wordpress: 4.7
    X theme: 4.6.4

    Thanks.

    #1297356
    Nico
    Moderator

    Hi There,

    Thanks for writing in.

    In regards to which part that you need to customize, you could follow the linke below,

    https://community.theme.co/forums/topic/renew-stack-modify-portfolio-page/

    Although the code is outdated, you could follow which file you need to copy in order to customize.

    Hope it helps.

    Let us know it goes.

    Thanks.

    #1297376
    STEVE H
    Participant

    Hi,

    I’m sorry but this isn’t leading to a solution. The page you referred me to shows how to create a template-layout-portfolio.php page, but it doesn’t explain how to modify the code so that I can show the category under the title on portfolio images (in Renew). The page you sent me to says that the user’s request #2, which involved displaying the category name (on hover instead of “image”) would require customization outside your support. I understand if that’s the case. But a while back, you were able to guide me to adding the category to portfolio items on the index pages: https://community.theme.co/forums/topic/show-category-under-title-under-the-images-on-portfolio-index-page-in-ethos/
    I was hoping for a similar solution for displaying the category with the title on individual portfolio items (as opposed to the index page). Thanks for looking again.

    #1297382
    STEVE H
    Participant

    This may be what I am trying to do, but it is for Integrity, not Renew:

    https://community.theme.co/forums/topic/display-the-portfolio-category/

    To clarify what I’m trying to do: In Renew, when one hovers over a portfolio item on the index pages, you can see the post type, date, and title. I would like to display the category as well. (In my previous post, I mistakenly said I wanted to display the category on the individual portfolio item page, but I meant the index page that shows all the portfolio posts.)

    #1297671
    Rad
    Moderator

    Hi there,

    Thanks for clarification 🙂

    1. Copy this file VIEWS/RENEW/CONTENT-PORTFOLIO.PHP to your child theme (eg. /wp-content/themes/x-child/framework/views/renew/contet-portfolio.php

    2. Edit that file and add this code just above or below this line <span><?php echo get_the_date( 'm.d.y' ); ?></span>

    <?php
               if ( has_term( '', 'portfolio-category', NULL ) ) {
            $categories        = get_the_terms( get_the_ID(), 'portfolio-category' );
            $separator         = ', ';
            $categories_output = '';
            foreach ( $categories as $category ) {
              $categories_output .= '<a href="'
                                  . get_term_link( $category->slug, 'portfolio-category' )
                                  . '" title="'
                                  . esc_attr( sprintf( __( "View all posts in: &ldquo;%s&rdquo;", '__x__' ), $category->name ) )
                                  . '"><i class="x-icon-bookmark" data-x-icon=""></i> '
                                  . $category->name
                                  . '</a>'
                                  . $separator;
            }
    
            $categories_list = sprintf( '<span>%s</span>',
              trim( $categories_output, $separator )
            );
          } else {
            $categories_list = '';
          } 
    
          echo '<span>'.$categories_list.'</span>';
    
          ?>

    3. Save and upload it.

    Hope this helps.

    #1298105
    STEVE H
    Participant

    Brilliant, that worked perfectly. Thank you.

    Now, a second request (which I should have mentioned earlier): How can I hide the post type (“image”) and date on the portfolio items (on hover)?

    There are several forum posts about this, but none of them are working. (One CSS modification hides all the meta, another doesn’t do anything, etc.) Can this be done with CSS, or do we need to modify the contet-portfolio.php some more?

    Thanks again. Your support team is fantastic.

    #1298136
    Paul R
    Moderator

    Hi,

    You can add this under Custom > Edit Global CSS in the Customizer.

    
    .x-portfolio .entry-cover-content span {
        display: none;
    }
    

    Hope that helps.

    #1298140
    STEVE H
    Participant

    That was one of the CSS modifications I had tried, but unfortunately it also hid the Category. I want to display the title and category and hide the post type and date. Thanks again.

    #1298200
    Lely
    Moderator

    Hello Steve,

    To help you better with this, can you give us admin credentials and sample page URL so we can be specific on our suggestion. The following might hide the date, but if it doesn’t work we need to check your structure.

    .x-portfolio .entry-cover-content span+h2+span {
        display: none;
    }

    Hope this helps.

    #1298217
    STEVE H
    Participant

    That helped. Thanks. It hid the date. Can we also hide the post type (“IMAGE”) which appears above the title, while still keeping the category?

    #1298362
    Jade
    Moderator

    Hi Steve,

    Please try to add this code:

    .x-portfolio .entry-cover-content span:first-child {
        display: none;
    }

    Hope this helps.

    #1298371
    STEVE H
    Participant

    That hides the “IMAGE” text but also hides the category.

    #1298553
    Darshana
    Moderator

    Hi there,

    Upon checking, I see that you have enabled maintenance mode. Could you please provide us a way to access your site, so that we can assist you with a possible workaround.

    Thanks!

    #1298583
    STEVE H
    Participant
    This reply has been marked as private.
    #1299027
    Lely
    Moderator

    Hi There,

    Thank you for that information.
    Please try this custom CSS:

    .x-portfolio .entry-cover-content>span:first-of-type {
        display: none;
    }

    Hope this helps.

  • <script> jQuery(function($){ $("#no-reply-1297329 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>