Offset is not working for Grid Title Overlay

Professional social WordPress theme with metro design, fully-adjustable grid widget and BuddyPress support.
GK User
Sun Aug 30, 2015 2:05 pm
I have added Grid Title Overlay to Gird tile. I need to show 2 posts of custom post type. For first grid to i have added offset 0 and for second tile i have added 1 in offset. But it is only showing latest post of "custom post type".
User avatar
Fresh Boarder

GK User
Mon Aug 31, 2015 9:57 am
Hi,

I'm afrad that the offset doesn't work with custom post types - only posts.

Try to edit Msocial/gavern/widgets.grid.titleoverlay.php file and change this fragment:
Code: Select all
} else if($config['data_source_type'] == 'custom') {
         $post_type = explode(',', $config['data_source']);
         array_push($results, get_posts(array('post_type' => $post_type, 'numberposts' => $amount_of_posts)));
      }


into:
Code: Select all
} else if($config['data_source_type'] == 'custom') {
         $post_type = explode(',', $config['data_source']);
         array_push($results, get_posts(array(
            'post_type' => $post_type,
            'numberposts' => $amount_of_posts),
            'offset' => $config['offset']
         ));
      }
User avatar
Moderator


cron