Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #16124

    I made some adjustments to the PHP and I think I commented out the links that allow you to sort the portfolio items on the home page.

    Can you tell me which PHP file contains this or whether there is an option to turn them back on?

    #90263

    Hello,

    I guess you are talking about the loop-portfolio.php located in the includes folder. This is the code responsible for it.

    if(!isset($avia_config['portfolio_sorting']) || $avia_config['portfolio_sorting'] == 'yes')
    {
    if(!empty($categories[0]))
    {
    $output = "<div id='js_sort_items' >";

    $hide = "hidden";
    if (isset($categories[1])){ $hide = ""; }

    $output .= "<div class='sort_by_cat $hide '>";
    $output .= "<a href='#' data-filter='all_sort' class='all_sort_button active_sort'>".__('All','avia_framework')."</a>";

    foreach($categories as $category)
    {
    $output .= "<span class='text-sep ".$category->category_nicename."_sort_sep'>/</span><a href='#' data-filter='".$category->category_nicename."_sort' class='".$category->category_nicename."_sort_button' >".$category->cat_name."</a>";
    $container_id .= $category->term_id;
    }

    $output .= "</div>";

    $output .= "</div>";

    echo $output;
    }
    }

    If you want to restore the whole file this is the whole code for loop-portfolio.php.

    <?php
    /*
    * The Loop for portfolio overview pages. Works in conjunction with the file template-portfolio.php and taxonomy-portfolio_entries.php
    */

    global $avia_config;
    $avia_config['avia_is_overview'] = true;

    if(isset($avia_config['new_query'])) { query_posts($avia_config['new_query']); }

    $loop_counter = 1;
    // check if we got a page to display:
    if (have_posts()) :

    $extraClass = 'first';
    $style = 'portfolio-entry-no-description';

    $grid = 'one_fourth';
    $image_size = 'portfolio';

    switch($avia_config['portfolio_columns'])
    {
    case "1": $grid = 'fullwidth'; $image_size = 'fullsize'; break;
    case "2": $grid = 'one_half'; break;
    case "3": $grid = 'one_third'; break;
    case "4": $grid = 'one_fourth'; break;
    }

    $avia_config['portfolio_columns_iteration'] = $avia_config['portfolio_columns'][0];
    if(!isset($avia_config['remove_portfolio_text'])) $style = 'portfolio-entry-description';

    $includeArray = "";
    if(isset($avia_config['new_query']['tax_query'][0]['terms'])) $includeArray = $avia_config['new_query']['tax_query'][0]['terms'];

    $args = array(

    'taxonomy' => 'portfolio_entries',
    'hide_empty'=> 0,
    'include' => $includeArray

    );

    $categories = get_categories($args);
    $container_id = "";

    if(!isset($avia_config['portfolio_sorting']) || $avia_config['portfolio_sorting'] == 'yes')
    {
    if(!empty($categories[0]))
    {
    $output = "<div id='js_sort_items' >";

    $hide = "hidden";
    if (isset($categories[1])){ $hide = ""; }

    $output .= "<div class='sort_by_cat $hide '>";
    $output .= "<a href='#' data-filter='all_sort' class='all_sort_button active_sort'>".__('All','avia_framework')."</a>";

    foreach($categories as $category)
    {
    $output .= "<span class='text-sep ".$category->category_nicename."_sort_sep'>/</span><a href='#' data-filter='".$category->category_nicename."_sort' class='".$category->category_nicename."_sort_button' >".$category->cat_name."</a>";
    $container_id .= $category->term_id;
    }

    $output .= "</div>";

    $output .= "</div>";

    echo $output;
    }
    }

    //portfolio container
    echo "<div class='ajax-portfolio-response-wrapper'>";
    echo "<div class='ajax-control'><a href='#' class='ajax-close'><span>x</span></a><a href='#' class='ajax-next'><span>+</span></a><a href='#' class='ajax-prev'><span>-</span></a></div>";
    echo "<div class='ajax-portfolio-response'></div>";
    echo "</div>";

    echo "<div class='portfolio-sort-container ".$avia_config['portfolio_hover']."'>";
    //iterate over the posts
    while (have_posts()) : the_post();

    //get the categories for each post and create a string that serves as classes so the javascript can sort by those classes
    $sort_classes = "";
    $item_categories = get_the_terms( $id, 'portfolio_entries' );

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

    if(!empty($avia_config['portfolio_ajax'])) $sort_classes .= " ajax_portfolio";

    ?>

    <div data-ajax-id='<?php echo get_the_ID();?>' class='post-entry post-entry-<?php echo get_the_ID();?> flex_column all_sort no_margin <?php echo $sort_classes.' '.$grid.' '.$extraClass.' '.$style; ?>'>

    <div class='inner-entry'>
    <?php

    echo "<h1 class='post-title portfolio-title'>";
    echo "<span class='primary-background title-span'></span>";
    echo "<a href='".get_permalink()."' rel='bookmark' title='".__('Permanent Link:','avia_framework')." ".get_the_title()."'>".get_the_title()."</a>";
    echo "</h1>";

    $forceSmall = true;
    $slider = new avia_slideshow(get_the_ID());
    $slider -> setImageSize($image_size);
    if(!empty($avia_config['portfolio_ajax'])) $slider -> set_links(get_permalink());

    echo $slider->display($forceSmall);

    ?>
    </div>
    <!-- end post-entry-->
    </div>

    <?php

    $loop_counter++;
    $extraClass = "";

    if($loop_counter > $avia_config['portfolio_columns_iteration'])
    {
    $loop_counter = 1;
    $extraClass = 'first';
    }

    endwhile;

    echo "</div>"; // end portfolio-sort-container

    if(!isset($avia_config['remove_pagination'] ))
    {
    echo "<div class='hr hr_invisible'></div>";
    echo avia_pagination();
    }
    echo "<!-- end -->"; //dont remove
    else:
    ?>

    <div class="entry">
    <h1 class='post-title'><?php _e('Nothing Found', 'avia_framework'); ?></h1>
    <p><?php _e('Sorry, no posts matched your criteria', 'avia_framework'); ?></p>
    </div>
    <?php

    endif;

    unset($avia_config['avia_is_overview']);
    ?>

    Regards,

    Ismael

    #90264

    Hello again,

    Also there is an option to turn it on and off. Go to Theme Options > Portfolio and look for Portfolio Sortable?, choose yes.

    Regards,

    Ismael

    #90265

    Nothing is working. I tried restoring the files and changing the option to portfolio sortable, but its not working. Please help.

    #90266

    Hi,

    What are files did you edit?

    Regards,

    Ismael

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

The topic ‘Links above Portfolio Section Missing’ is closed to new replies.