本文整理汇总了PHP中RevSlider::initByMixed方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSlider::initByMixed方法的具体用法?PHP RevSlider::initByMixed怎么用?PHP RevSlider::initByMixed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevSlider
的用法示例。
在下文中一共展示了RevSlider::initByMixed方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRevSlider
public function getRevSlider()
{
if (!$this->slider && ($alias = $this->getParam('activeRevSlider'))) {
$this->slider = new RevSlider();
$this->slider->initByMixed($alias);
}
return $this->slider;
}
示例2: yit_add_slider_class_body
/**
* Remove Add to wishlist text option
*
*/
function yit_add_slider_class_body()
{
$slider_name = yit_slider_name();
if ($slider_name == 'none' || empty($slider_name)) {
return;
}
$slider_type = yit_slider_get_setting('slider_type', $slider_name);
$slider_width = yit_slider_get_setting('width_' . $slider_type, $slider_name);
if (in_array($slider_type, array('revolution', 'revolution-slider', 'elastic', 'thumbnails')) && $slider_width == 0) {
$is_full_width = true;
} else {
$is_full_width = false;
}
// revolution slider
if ($slider_type == 'revolution-slider' && class_exists('RevSlider')) {
$revolution = yit_slider_get_setting('slider_name_' . $slider_type, $slider_name);
$the_slider = new RevSlider();
$the_slider->initByMixed($revolution);
if (in_array($the_slider->getParam('slider_type'), array('fixed', 'responsitive'))) {
$is_full_width = false;
}
}
yit_add_body_class('header-slider-' . $slider_type);
yit_add_body_class('slider-' . ($is_full_width ? 'full-width' : 'fixed'));
}
示例3: build
static function build($post)
{
$description = str_replace(']]>', ']]>', apply_filters('the_content', get_the_content()));
$standard_details = wpcasa_standard_details();
$custom = get_post_custom($post->ID);
$price = $custom['_price'][0];
$address = $custom['_map_address'][0];
$property = new ctwizPropertyModel(array("id" => (string) $post->ID, "url" => esc_url(apply_filters('the_permalink', get_permalink())), 'description' => $description, 'publishDate' => get_the_modified_time('U'), 'requested' => $price, 'currency' => wpcasa_get_currency(), 'address' => $address));
$type_terms = get_the_terms($post->ID, "property-type");
if ($type_terms) {
foreach ($type_terms as $term) {
$prope = ctwizKeywordModel::_($term->name, "types");
if ($prope) {
$property->houseType = $prope;
break;
}
}
} else {
return false;
}
$agent_display_option = get_post_meta($post->ID, 'REAL_HOMES_agent_display_option', true);
if ($agent_display_option == "my_profile_info") {
$property->agentMobilePhone = get_the_author_meta('mobile_number');
$property->agentPhone = get_the_author_meta('office_number');
$property->agentFax = get_the_author_meta('fax_number');
$property->agentEmail = get_the_author_meta('user_email');
$property->agentName = get_the_author_meta('display_name');
} else {
$property_agent = get_post_meta($post->ID, 'REAL_HOMES_agents', true);
if (!empty($property_agent) && intval($property_agent) > 0) {
$agent_id = intval($property_agent);
$property->agentMobilePhone = get_post_meta($agent_id, 'REAL_HOMES_mobile_number', true);
$property->agentPhone = get_post_meta($agent_id, 'REAL_HOMES_office_number', true);
$property->agentFax = get_post_meta($agent_id, 'REAL_HOMES_fax_number', true);
$property->agentEmail = get_post_meta($agent_id, 'REAL_HOMES_agent_email', true);
$property->agentName = get_the_title($agent_id);
}
}
if (!empty($standard_details)) {
foreach ($standard_details as $feature => $value) {
$property_details_value = get_post_meta(get_the_ID(), '_' . $feature, true);
$prop = ctwizKeywordModel::_($value['label']);
if ($prop) {
// echo $property_details_value."\n";
$property->{$prop} = $property_details_value;
}
}
}
$property_features_terms = get_the_terms(get_the_ID(), 'feature');
if ($property_features_terms) {
foreach ($property_features_terms as $term) {
$prop = ctwizKeywordModel::_($term->name);
if ($prop) {
$property->{$prop} = true;
}
}
}
$status = $custom['_price_status'][0];
if (!empty($status)) {
$prope = ctwizKeywordModel::_($status);
if ($prope == "forRent") {
$property->forRent = true;
}
if ($prope == "forSale") {
$property->forSale = true;
}
}
$properties_images = get_posts(array("post_parent" => intval($post->ID), 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID'));
$photos = array();
foreach ($properties_images as $image_id) {
$photos[] = array('url' => wp_get_attachment_url($image_id->ID), 'caption' => $image_id->post_name);
}
// get rev slider
if (isset($custom['_space'][0])) {
list($a, $b) = explode(" ", str_replace(array("[", "]"), array("", ""), $custom['_space'][0]));
try {
$slider = new RevSlider();
$slider->initByMixed($b);
$slides = $slider->getSlides(true);
foreach ($slides as $slide) {
$photos[] = array('url' => $slide->getImageUrl());
}
} catch (Exception $e) {
//don't care
}
}
if (has_post_thumbnail()) {
$image_id = get_post_thumbnail_id();
$image_url = wp_get_attachment_url($image_id);
$photos[] = array('url' => $image_url);
}
$property->photos = $photos;
return $property;
}
示例4: define
* http://www.gnu.org/licenses/gpl-3.0.txt
*/
if (!defined('ABSPATH')) {
exit;
}
// Exit if accessed directly
global $is_primary;
if (!class_exists('RevSlider')) {
return;
}
if (!defined('YIT_SLIDER_USED')) {
define('YIT_SLIDER_USED', true);
}
$sliderID = $slider->get('config-slider_name');
$the_slider = new RevSlider();
$the_slider->initByMixed($sliderID);
$slider_class = '';
//$slider_class .= yit_slide_get('align') != '' ? ' align' . yit_slide_get('align') : '';
$slider_class .= ' ' . $the_slider->getParam('slider_type');
$is_fixed = false;
if (!$is_primary && in_array($the_slider->getParam('slider_type'), array('fixed', 'responsitive'))) {
$is_fixed = true;
}
// text align
//$slider_text = yit_slide_get( 'slider_text' );
//if ( ! $is_fixed ) $slider_text = '';
//if ( !empty( $slider_text ) ) $slider_class .= ' align' . ( yit_slide_get( 'slider_align' ) == 'left' ? 'right' : 'left' );
?>
<!-- START SLIDER -->
<div class="revolution-wrapper<?php