Your address will show here +12 34 56 78

Home Forums WP RESIDENCE – Real Estate WordPress Theme FORUM Properties List – Default View changed to List (how to change in code) – GRID / LIST Reply To: Properties List – Default View changed to List (how to change in code) – GRID / LIST

#100677

pmaldonado
Participant

So after adding $col_class = 'col-md-12'; in line 52 at property_unit.php … i did this:

1) in /templates/property_list_filters.php i changed the initial selected icon to be the list view.. if that is not done, the list view would be showing as default but the icons show if it was the grid view selected. In the php file line 196 deleted the class icon_selected and added it to the list view id.

 <div class="listing_filter_select listing_filter_views">
            <div id="grid_view"> 
                <i class="fa fa-th"></i>
            </div>
        </div>

        <div class="listing_filter_select listing_filter_views">
             <div id="list_view" class="icon_selected">
                 <i class="fa fa-bars"></i>                   
             </div>
        </div>

2) The script still works in a wrong way as it, swaps the icon selected between grid view o list view, even if you’re not changing views. To fix this just added some if statements in /js/control.js around line 1224 (i have modified this file so i really don’t know if the line is correct but it says ///////grid to list view before the code.

 $('#list_view').click(function(){
    if ($(this).hasClass('icon_selected')) {  
    }
    else{
         $(this).toggleClass('icon_selected');
         $('#listing_ajax_container').addClass('ajax12');
         $('#grid_view').toggleClass('icon_selected');      
         $('.listing_wrapper').hide().removeClass('col-md-4').removeClass('col-md-3').addClass('col-md-12').fadeIn(400) ;
         $('.the_grid_view').fadeOut(10,function() {
            $('.the_list_view').fadeIn(300);
         });
    }
     })

     
     
     $('#grid_view').click(function(){
        if ($(this).hasClass('icon_selected')) {  
        }
        else{
               var class_type;
         class_type = $('.listing_wrapper:first-of-type').attr('data-org');
         $(this).toggleClass('icon_selected');
         $('#listing_ajax_container').removeClass('ajax12');
         $('#list_view').toggleClass('icon_selected');
         $('.listing_wrapper ').hide().removeClass('col-md-12').addClass('col-md-'+class_type).fadeIn(400); 
         $('.the_list_view').fadeOut(10,function(){
              $('.the_grid_view').fadeIn(300);
         });
        }
     })