Beispiel #1
0
<?php

/*
 * AIT WordPress Theme
 *
 * Copyright (c) 2013, Affinity Information Technology, s.r.o. (http://ait-themes.com)
 */
global $latteParams;
$latteParams['post'] = WpLatte::createPostEntity(get_post(woocommerce_get_page_id('shop')), array('meta' => $GLOBALS['pageOptions']));
WpLatte::createTemplate(__FILE__, $latteParams)->render();
<?php

$latteParams['bodyClasses'] .= ' with-sidebar';
$latteParams['bodyId'] = 'normal-page';
$latteParams['post'] = WpLatte::createPostEntity($wp_query->post, array('meta' => $pageOptions));
$latteParams['post']->classes = implode(' ', get_post_class());
/* Parse video provider */
global $wpdb;
$sql = "SELECT meta_value FROM " . $wpdb->prefix . "postmeta WHERE post_id=" . $latteParams['post']->id . " AND meta_key LIKE '%_ait%'";
$itemMeta = $wpdb->get_results($sql);
$itemMetaValue = unserialize($itemMeta[0]->meta_value);
if ($itemMetaValue['itemType'] == NULL) {
    $itemMetaValue['itemType'] = 'image';
}
$itemMetaValue['videoAutoplay'] = 0;
/* Parse video provider && video id*/
if (strpos($itemMetaValue['videoLink'], 'vimeo') != false) {
    $itemMetaValue['videoProvider'] = 'vimeo';
    $itemMetaValue['videoID'] = str_replace('http://vimeo.com/', '', $itemMetaValue['videoLink']);
} else {
    $itemMetaValue['videoProvider'] = 'youtube';
    $temp = str_replace('http://www.youtube.com/watch?v=', '', $itemMetaValue['videoLink']);
    $itemMetaValue['videoID'] = substr($temp, 0, strpos($temp, '&'));
}
$latteParams['gridGalleryOptions'] = $itemMetaValue;
/* Parse video provider */
WpLatte::createTemplate(basename(__FILE__, '.php'), $latteParams)->render();