Codeless
  • Support Home
  • Themes
  • Support
  • WordPress Tutorials
    • How to Start a Blog
    • Best Website Builders
    • Best Small Business Hosting
    • Email Marketing Services
    • Cheap WordPress Hosting
  • Video Tutorials

Community Forums

Portfolio Categories

    • 5 years, 3 months ago amccreative
      Participant

      Expired

      Hi there. The client would like the portfolio categories text to render in a proper text format, as opposed to slug format. For example they have a portfolio category ‘Project Management’, but when you mouse over the portfolio items, the category reads ‘project-management’ (lower case and with a hyphen between words). Also when there’s more than 1 category there needs to be separator between them (even a comma is better than nothing). Here’s a screen shot:

      Please check out their portfolio page:

      Project Case Studies

      Your support here is much appreciated, Thanks Mike.

      • This topic was modified 5 years, 3 months ago by amccreative.
    • 5 years, 3 months ago Ruco
      Keymaster

      Hello,

      You can fix that by editing the file: includes/view/portfolio/loop-grid.php.

      Edit the code :

      
      if(is_object($item_categories) || is_array($item_categories))
          	{
          		foreach ($item_categories as $cat)
          		{
          			$sort_classes .= $cat->slug.' ';
          		}
          	}
      

      replace with:

      
      if(is_object($item_categories) || is_array($item_categories))
          	{
          		foreach ($item_categories as $cat)
          		{
          			$sort_classes .= $cat->slug.' ';
                              $category_name .= $cat->name.', ';
          		}
          	}
      

      also, you have to edit the code:

      
       <div class="center-bar v1">
                                                          <h4 data-animate="fadeInDown" class="a1"><?php echo get_the_title() ?></h4>
                                                          <h6 data-animate="fadeInUp" class="a2"><?php echo codeless_complex_esc($sort_classes) ?></h6>
                                                      </div>
      

      replace with:

      
      
       <div class="center-bar v1">
                                                          <h4 data-animate="fadeInDown" class="a1"><?php echo get_the_title() ?></h4>
                                                          <h6 data-animate="fadeInUp" class="a2"><?php echo codeless_complex_esc($category_name) ?></h6>
                                                      </div>
      
      

      Let us know.

      Regards!

    • 5 years, 3 months ago amccreative
      Participant

      Expired

      This reply has been marked as private.
    • 5 years, 3 months ago amccreative
      Participant

      Expired

      I can see you are currently working on the code, thanks. Another smaller issue is that the side bar portfolio/project info  (custom fields) in response loses its left alignment. See screen shot:

       

      https://www.compasspm.com.au/projects/quay-quarter-loftus-lane/

      [caption id="" align="alignnone" width="511"] responsive / custom fields text align[/caption]

    • 5 years, 3 months ago Ruco
      Keymaster

      Hello,

      Please can you check it now.

      Let me know.

      Regards!

    • 5 years, 3 months ago amccreative
      Participant

      Expired

      Thanks but its now only showing one category. have look at the portfolio pages:

      https://www.compasspm.com.au/wp-admin/edit.php?post_type=portfolio

      The projects Chatswood, ANU, Watergardens & Roselands all have two project categories

    • 5 years, 3 months ago amccreative
      Participant

      Expired

      Really appreciate your help here Ruco, but when you mouse over on recent projects/portoflio it only shows the one category (all browser types)… and the alignment of project info (custom fields in responsive) is still out.

    • 5 years, 3 months ago amccreative
      Participant

      Expired

      Don’t worry about the project info/details text indent in responsive I’ll fix that bit. Please see if you can add the multiple categories when mouse over recent portfolio items. Thanks.

    • 5 years, 3 months ago amccreative
      Participant

      Expired

      Can you please help, the multiple categories are not showing.

    • 5 years, 3 months ago Ludjon
      Keymaster

      Please add this manually, i cant from dashboard:

      tower/includes/portfolio/loop-grid.php

      replace with:

      <?php
      
      global $cl_redata;
      global $used_for_element;
      
      $columns = (isset($used_for_element)) ? $used_for_element['columns'] : $cl_redata['portfolio_columns'];
      $sidebar = $cl_redata['layout'];
      $style = (isset($used_for_element)) ? $used_for_element['style'] : $cl_redata['portfolio_style'];
      
      $extra_class = '';
      if(isset($used_for_element) && $used_for_element['carousel'] == 'yes')
          $extra_class .= ' swiper-slide';
      
      if(!isset($used_for_element))
          codeless_set_portfolio_query(); 
      
      if(have_posts()){
          $item_grid_class = '';
          
          switch($columns){
              case "1": $item_grid_class = 12; break;
              case "2": $item_grid_class = 6; break;
              case "3": $item_grid_class = 4; break;
              case "4": $item_grid_class = 3; break;
              case "5": $item_grid_class = 5; break;
              case "6": $item_grid_class = 6; break;
          }
           
          ?>
          
          <?php if(!isset($used_for_element)): ?>
              <div class="filterable row">
          <?php endif ?>
      
          <?php
      
          $the_id = 0;
          $loop_counter = 0;
      
          while (have_posts()) : the_post();	
      	
      		$loop_counter++;
          	$the_id 	= get_the_ID();
      
          	$sort_classes = "";
          	$item_categories = get_the_terms( $the_id, 'portfolio_entries' );
              $catname = '';
          	if(is_object($item_categories) || is_array($item_categories))
          	{
          		foreach ($item_categories as $cat)
          		{
                      $sort_classes .= $cat->slug.' ';
                      $catname .= $cat->name. ' ';
          		}
          	}
      
              $cats = wp_get_object_terms(get_the_ID(), 'portfolio_entries');
              $link = get_permalink();
              if($cl_redata['single_custom_link_switch'] && !empty($cl_redata['single_custom_link']))
                  $link = $cl_redata['single_custom_link'];
          ?>
            
             <!-- Portfolio Normal Mode -->
             <?php if($style == 'overlayed'){ ?>
          <!-- item -->
              
          	                    <div class="portfolio-item mix <?php echo esc_attr($sort_classes) ?> <?php echo esc_attr($extra_class) ?> <?php echo esc_attr($style) ?>" data-id="<?php echo esc_attr(get_the_ID()) ?>">
                                              <div class="he-wrap tpl2">
                                              <a href="<?php echo esc_url($link) ?>"></a>
      
                                              <?php if($item_grid_class == 5){ ?>
                                                  <img src="<?php echo esc_url(codeless_image_by_id(get_post_thumbnail_id(), 'port4', 'url')) ?>">
                                         
                                              <?php } ?>
                                              <?php if($item_grid_class == 3){ ?>
                                                  <img src="<?php echo esc_url(codeless_image_by_id(get_post_thumbnail_id(), 'port4', 'url')) ?>">
                                         
                                              <?php } ?>
                                              <?php if($item_grid_class == 4){ ?>
                                                  <img src="<?php echo esc_url(codeless_image_by_id(get_post_thumbnail_id(), 'port3', 'url')) ?>">
                                                
      						 <?php } ?>
                                              <?php if($item_grid_class == 6){ ?>
                                                  <img src="<?php echo esc_url(codeless_image_by_id(get_post_thumbnail_id(), 'port2', 'url')) ?>">
                                               
      						<?php } ?>
                                              <?php if($item_grid_class == 12){ ?>
                                                  <img src="<?php echo esc_url(codeless_image_by_id(get_post_thumbnail_id(), 'port1', 'url')) ?>">
                                             	 
      						 <?php } ?>
                                             <div class="overlay he-view">
                                                  <div class="bg a0" data-animate="fadeIn">
                                                      <div class="center-bar v1">
                                                          <h4 data-animate="fadeInDown" class="a1"><?php echo get_the_title() ?></h4>
                                                          <h6 data-animate="fadeInUp" class="a2"><?php echo codeless_complex_esc($catname) ?></h6>
                                                      </div>
                                                  </div>
                                                   
                                              </div>   
                                                  
                                                  
                                                      
                                           </div>      
                                                 
      	                    </div>
                  <?php }else if($style == 'grayscale'){ ?>
                    <div class="portfolio-item mix <?php echo esc_attr($sort_classes) ?> <?php echo esc_attr($extra_class) ?>  <?php echo esc_attr($style) ?>" data-id="<?php echo get_the_ID() ?>">
                                              <div class="">
                                                  <?php if($item_grid_class == 5){  ?>
                                                      <img src="<?php echo esc_url(codeless_image_by_id(get_post_thumbnail_id(), 'port4', 'url')) ?>">
                                                 
                                                  <?php } ?>
                                                  <?php if($item_grid_class == 3){  ?>
                                                      <img src="<?php echo esc_url(codeless_image_by_id(get_post_thumbnail_id(), 'port4', 'url')) ?>">
                                                 
                                                  <?php } ?>
                                                  <?php if($item_grid_class == 4){ ?>
                                                      <img src="<?php echo esc_url(codeless_image_by_id(get_post_thumbnail_id(), 'port3_grayscale', 'url')) ?>">
                                                
                                   <?php } ?>
                                                  <?php if($item_grid_class == 6){ ?>
                                                      <img src="<?php echo esc_url(codeless_image_by_id(get_post_thumbnail_id(), 'port2_grayscale', 'url')) ?>">
                                                  
                                  <?php } ?>
                                                  <?php if($item_grid_class == 12){ ?>
                                                      <img src="<?php echo esc_url(codeless_image_by_id(get_post_thumbnail_id(), 'port1', 'url')) ?>">
                                                
                                   <?php } ?>
                                                 <div class="project">
                                                      <h5><a href="<?php echo esc_url($link) ?>"><?php echo get_the_title() ?></a></h5>
                                                      <h6><?php echo esc_html($sort_classes) ?></h6>
                                                  </div>   
                                                  
                                                  
                                                      
                                              </div>          
                                              
                                                 
                              </div>
      
                  <?php }else if($style == 'basic'){ ?>
      
                       <div class="portfolio-item mix <?php echo esc_attr($sort_classes) ?> <?php echo esc_attr($extra_class) ?>  <?php echo esc_attr($style) ?>" data-id="<?php echo get_the_ID() ?>">
                          <div class="he-wrap tpl2">
                              <?php if($columns == 5) $columns = 4; ?>                
                              <img src="<?php echo esc_url(codeless_image_by_id(get_post_thumbnail_id(), 'port'.$columns, 'url')) ?>" >
                                           
                              <div class="overlay he-view">
                                  <div class="bg a0" data-animate="fadeIn">
                                      <div class="center-bar v1">
                                          <?php if(!$cl_redata['portfolio_remove_magnifier']): ?>
                                               <a href="<?php echo esc_url(codeless_image_by_id(get_post_thumbnail_id(), array("width"=> 1200, "height" => 1200), "url")) ?>" class="link a1 lightbox-gallery lightbox" data-animate="fadeInLeft"><i class="moon-search-3"></i></a></a>
                                           <?php endif; ?>    
                                          <a href="<?php echo esc_url($link) ?>" class="link a1" data-animate="fadeInRight"><i class="moon-link-4"></i></a></a>
                                      </div>
                                   </div> 
                              </div>                          
                          </div>   
      
                                           
                          <div class="show_text">
                              <h5><a href="<?php echo esc_url($link) ?>"><?php echo get_the_title() ?></a></h5>
                              <h6><?php echo esc_html($sort_classes) ?></h6>
                          </div>         
                       
                      </div>
      
                  <?php }else if($style == 'chrome'){ ?>
                      
                      <div class="portfolio-item mix <?php echo esc_attr($sort_classes) ?> <?php echo esc_attr($extra_class) ?>  <?php echo esc_attr($style) ?>" data-id="<?php echo get_the_ID() ?>">
                          <div class="overlay">
                              <div class="bar"></div>
                              <img src="<?php echo esc_url(codeless_image_by_id(get_post_thumbnail_id(), 'staff_full', 'url')) ?>">
                              <span>
                                  <a href="<?php echo esc_url($link) ?>" class="btn-bt <?php echo esc_attr($cl_redata['overall_button_style'][0]) ?>"><?php esc_html_e('View', 'tower') ?></a>
                              </span>
                          </div>
                                
                          <div class="show_text">
                              <h5><a href="<?php echo esc_url($link) ?>"><?php echo get_the_title() ?></a></h5>
                          </div>         
                       
                      </div>
      
                  <?php } ?>
              <!-- Portfolio Normal Mode End -->
      
      <?php endwhile;  ?>
      
      <?php if(!isset($used_for_element)): ?>
          </div>
      <?php endif; ?>
      
      <?php } ?>
      
      <?php if(!isset($used_for_element)): ?>
      
      <?php codeless_pagination_display(); ?>
      
      <?php endif; ?>

      Thanks

    • 5 years, 3 months ago amccreative
      Participant

      Expired

      Thanks mate. This is a live client site, so wasn’t aware the portfolio feed was down. All good now.

Viewing 10 reply threads

You must be logged in to reply to this topic.

Login

Log In
Register

Renew Support

  • Renew Specular Support
  • Renew Tower Support
  • Renew Folie Support
  • Renew Handel Support
  • Renew June Support
  • Renew Picante Support
  • Renew Thype Support
  • Renew Regn Support

Search Forums

Forums

  • Bygge – Construction Theme
  • Converta – Software Theme
  • Folie – The WordPress Website Builder
  • Handel – Responsive Multi-Purpose Business Theme
  • June WooCommerce WordPress Theme
  • Livecast – Podcast Theme
  • Picante – Restaurant & Food WordPress Theme
  • Regn | Agency & Business WordPress Theme
  • Remake – Minimal Portfolio & Agency Theme
  • Specular – Multi-Purpose WordPress Theme
  • Suggest us Features
  • Tower – Business-Driven Multipurpose WP Theme
  • Vibrance – Photography Theme

Site Links

  • Support Policy
  • Specular Support Forum
  • Video Tutorials
  • Knowledge Base
  • Guides and Reviews

Useful Articles

  • Build a Website
  • Web Design & Development
  • Hosting
  • WordPress

Login

Log In
Register Lost Password