Osclass forums

Support forums => Themes => Bender => Topic started by: itcafeonline on April 29, 2015, 11:45:04 pm

Title: <Solved>Bender - Homepage - Show only posts with Images
Post by: itcafeonline on April 29, 2015, 11:45:04 pm
Bender - Homepage - Show only posts with Images (Only HOMEPAGE)

How to do this? Since the theme calls loop-grid and loop-list any changes into it will affect search results as well, Any pointers please?
Title: Re: Bender - Homepage - Show only posts with Images
Post by: itcafeonline on April 30, 2015, 03:25:56 am
here is what I have tried, but its not working. Pointers please...

1. Copied function osc_has_latest_items from hitems core file. to the theme functions file
2. Renamed to my_osc_has_latest_items
3. Set the $withPicture parameter to True
4. Changed osc_has_latest_items to my_osc_has_latest_items in main.php



   
Title: Re: Bender - Homepage - Show only posts with Images
Post by: teseo on April 30, 2015, 03:40:31 am
Hi,

Restore everything and do this:

bender/main.php, find:

Code: [Select]
<h1><strong><?php _e('Latest Listings''bender') ; ?></strong></h1>
 <?php if( osc_count_latest_items() == 0) { ?>

and replace it with:

Code: [Select]
<h1><strong><?php _e('Latest Listings''modern'); ?></strong></h1>

<?php $search Search::newInstance();
View::newInstance()->_exportVariableToView('latestItems'$search->getLatestItems(osc_max_latest_items(), array(), true));

if( 
osc_count_latest_items() == 0) { ?>


Regards
Title: Re: Bender - Homepage - Show only posts with Images
Post by: itcafeonline on April 30, 2015, 03:56:10 am
Wow thanks so much teseo. Thanks again!