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

Setting default category for portfolio page

portfolio category default
    • 9 years, 3 months ago lfangclairent
      Participant

      Expired

      Can you guide me as to which php file and what lines of code to change to set the default category for the portfolio page (i.e. not All)?

      I assume that I will have to set the slug name somewhere.

      Thank you

    • 9 years, 3 months ago Mirela
      Participant

      Hello,

      The responsible code snipped is located in file portfolio.php.

      Best regards!

    • 9 years, 3 months ago lfangclairent
      Participant

      Expired

      Sorry. Could you give me some more detail like a code snippet to get me started?

      Thank you,

      Leo

       

    • 9 years, 3 months ago Mirela
      Participant

      Hello,

      Look for these lines:

      <nav id="portfolio-filter" class="span12">
         <ul class="">
             <li class="filter active all" data-filter="all"><a href="#" class="filter active" data-filter="all"><?php _e('View All', 'codeless') ?></a></li>
                                  
                  <?php foreach($cl_redata['portfolio_categories'] as $cat): ?>
                        <?php $cat = get_term($cat, 'portfolio_entries'); ?>
                        <?php if(is_object($cat)): ?>
                              <li class="other filter"  data-filter=".<?php echo esc_attr($cat->slug) ?>"><a href="#" class="filter" data-filter=".<?php echo esc_attr($cat->slug) ?>"><?php echo esc_html($cat->name) ?></a></li>
                         <?php endif; ?>
                    <?php endforeach; ?>
           </ul>
      </nav>

      Best regards!

    • 9 years, 3 months ago lfangclairent
      Participant

      Expired

      This reply has been marked as private.
    • 9 years, 3 months ago Mirela
      Participant

      Hello,

      This block of code is responsible for the generation of categories filter bar in portfolio pages. This line:
      <li class="filter active all" data-filter="all"><php _e('View All', 'codeless') ></li>

      will display the “View All” (first tab). This is what you have to change. Edit data-filter="all" to the category you want to show.

      While this cycle here:
      <li class="other filter" data-filter=".<php echo esc_attr($cat->slug) ?>"><a href="#" class="filter" data-filter=".<php echo esc_attr($cat->slug) ?>"><php echo esc_html($cat->name) ?></a></li>
      will automatically list out all the available categories after the “View All” tab.
      Hide the category displayed first, from this list with custom css.

      Sorry but this is a custom edit and it’s not included in support service. This is all i can help you with.
      Please read more regarding our support policy here.

      Best regards!

Viewing 5 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