Advertisement:

Author Topic: <Solved>Bender - Homepage - Show only posts with Images  (Read 1088 times)

itcafeonline

  • Full Member
  • ***
  • Posts: 245
<Solved>Bender - Homepage - Show only posts with Images
« 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?
« Last Edit: April 30, 2015, 03:56:30 am by itcafeonline »

itcafeonline

  • Full Member
  • ***
  • Posts: 245
Re: Bender - Homepage - Show only posts with Images
« Reply #1 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



   
« Last Edit: April 30, 2015, 03:32:32 am by itcafeonline »

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Bender - Homepage - Show only posts with Images
« Reply #2 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

itcafeonline

  • Full Member
  • ***
  • Posts: 245
Re: Bender - Homepage - Show only posts with Images
« Reply #3 on: April 30, 2015, 03:56:10 am »
Wow thanks so much teseo. Thanks again!