本文整理汇总了PHP中axiom_get_custom_option函数的典型用法代码示例。如果您正苦于以下问题:PHP axiom_get_custom_option函数的具体用法?PHP axiom_get_custom_option怎么用?PHP axiom_get_custom_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了axiom_get_custom_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: axiom_show_share_links
function axiom_show_share_links($args)
{
if (axiom_get_custom_option('show_share') == 'hide') {
return '';
}
$args = array_merge(array('post_id' => 0, 'post_link' => '', 'post_title' => '', 'post_descr' => '', 'post_thumb' => '', 'size' => 'small', 'style' => 'icons', 'type' => 'block', 'popup' => true, 'counters' => axiom_get_custom_option('show_share_counters') == 'yes', 'direction' => axiom_get_custom_option('show_share'), 'caption' => axiom_get_custom_option('share_caption'), 'share' => axiom_get_theme_option('share_buttons'), 'echo' => true), $args);
if (count($args['share']) == 0 || implode('', $args['share'][0]) == '') {
return '';
}
global $AXIOM_GLOBALS;
$upload_info = wp_upload_dir();
$upload_url = $upload_info['baseurl'];
$output = '<div class="sc_socials sc_socials_size_' . esc_attr($args['size']) . ' sc_socials_share' . ($args['type'] == 'drop' ? ' sc_socials_drop' : ' sc_socials_dir_' . esc_attr($args['direction'])) . '">' . ($args['caption'] != '' ? '<span class="share_caption">' . $args['caption'] . '</span>' : '');
foreach ($args['share'] as $soc) {
$icon = $args['style'] == 'icons' || axiom_strpos($soc['icon'], $upload_url) !== false ? $soc['icon'] : axiom_get_socials_url(basename($soc['icon']));
$sn = basename($soc['icon']);
$sn = $args['style'] == 'icons' ? axiom_substr($sn, axiom_strrpos($sn, '-') + 1) : axiom_substr($sn, 0, axiom_strrpos($sn, '.'));
if (($pos = axiom_strrpos($sn, '_')) !== false) {
$sn = axiom_substr($sn, 0, $pos);
}
$url = empty($soc['url']) && !empty($AXIOM_GLOBALS['share_links'][$sn]) ? $AXIOM_GLOBALS['share_links'][$sn] : $soc['url'];
$link = str_replace(array('{id}', '{link}', '{title}', '{descr}', '{image}'), array(urlencode($args['post_id']), urlencode($args['post_link']), urlencode(strip_tags($args['post_title'])), urlencode(strip_tags($args['post_descr'])), urlencode($args['post_thumb'])), $url);
$output .= '<div class="sc_socials_item">' . '<a href="' . esc_url($soc['url']) . '"' . ' class="social_icons social_' . esc_attr($sn) . '"' . ($args['popup'] ? ' onclick="window.open(\'' . esc_url($link) . '\', \'_blank\', \'scrollbars=0, resizable=1, menubar=0, left=100, top=100, width=480, height=400, toolbar=0, status=0\'); return false;"' : ' target="_blank"') . ($args['style'] == 'bg' ? ' style="background-image: url(' . esc_url($icon) . ');"' : '') . ($args['counters'] ? ' data-count="' . esc_attr($sn) . '"' : '') . '>' . ($args['style'] == 'icons' ? '<span class="icon-' . esc_attr($sn) . '"></span>' : ($args['style'] == 'images' ? '<img src="' . esc_url($icon) . '" alt="' . esc_attr($sn) . '" />' : '<span class="sc_socials_hover" style="background-image: url(' . esc_url($icon) . ');"></span>')) . '</a>' . ($args['type'] == 'drop' ? '<i>' . trim(axiom_strtoproper($sn)) . '</i>' : '') . '</div>';
}
$output .= '</div>';
if ($args['echo']) {
echo $output;
}
return $output;
}
示例2: widget
/**
* How to display the widget on the screen.
*/
function widget($args, $instance)
{
extract($args);
$title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : '');
$text = isset($instance['text']) ? do_shortcode($instance['text']) : '';
$logo_image = isset($instance['logo_image']) ? $instance['logo_image'] : '';
$logo_text = isset($instance['logo_text']) ? $instance['logo_text'] : '';
$show_logo = isset($instance['show_logo']) ? (int) $instance['show_logo'] : 1;
$show_icons = isset($instance['show_icons']) ? (int) $instance['show_icons'] : 1;
/* Before widget (defined by themes). */
echo $before_widget;
/* Display the widget title if one was input (before and after defined by themes). */
if ($title) {
echo $before_title . $title . $after_title;
}
?>
<div class="widget_inner">
<?php
if ($show_logo) {
if ($logo_image == '') {
$logo_image = axiom_get_custom_option('logo_image');
}
if ($logo_text == '') {
$logo_text = axiom_get_custom_option('logo_text');
}
if ($logo_image != '' || $logo_text != '') {
?>
<div class="logo"><a href="<?php
echo esc_url(home_url());
?>
"><?php
echo $logo_image ? '<img src="' . esc_url($logo_image) . '" alt="">' : '';
echo $logo_text ? '<span class="logo_text">' . str_replace(array('[', ']'), array('<span class="menu_color">', '</span>'), $logo_text) . '</span>' : '';
?>
</a></div>
<?php
}
}
if (!empty($text)) {
?>
<div class="logo_descr"><?php
echo nl2br(do_shortcode($text));
?>
</div>
<?php
}
if ($show_icons) {
echo do_shortcode('[trx_socials][/trx_socials]');
}
?>
</div>
<?php
/* After widget (defined by themes). */
echo $after_widget;
}
示例3: axiom_core_customizer_add_custom_styles
function axiom_core_customizer_add_custom_styles($custom_style)
{
// Custom fonts
if (axiom_get_custom_option('typography_custom') == 'yes') {
$fonts = axiom_get_list_fonts(false);
$fname = axiom_get_custom_option('typography_p_font');
if (isset($fonts[$fname])) {
$fstyle = explode(',', axiom_get_custom_option('typography_p_style'));
$fname2 = ($pos = axiom_strpos($fname, ' (')) !== false ? axiom_substr($fname, 0, $pos) : $fname;
$i = in_array('i', $fstyle);
$u = in_array('u', $fstyle);
$c = axiom_get_custom_option('typography_p_color');
$custom_style .= "\n\t\t\t\t\tbody, button, input, select, textarea {\n\t\t\t\t\t\tfont-family: '" . esc_attr($fname2) . "'" . (isset($fonts[$fname]['family']) ? ", " . esc_attr($fonts[$fname]['family']) : '') . ";\n\t\t\t\t\t}\n\t\t\t\t\tbody {\n\t\t\t\t\t\tfont-size: " . esc_attr(axiom_get_custom_option('typography_p_size')) . "px;\n\t\t\t\t\t\tfont-weight: " . esc_attr(axiom_get_custom_option('typography_p_weight')) . ";\n\t\t\t\t\t\tline-height: " . esc_attr(axiom_get_custom_option('typography_p_lineheight')) . "px;\n\t\t\t\t\t\t" . ($c ? "color: " . esc_attr($c) . ";" : '') . "\n\t\t\t\t\t\t" . ($i ? "font-style: italic;" : '') . "\n\t\t\t\t\t\t" . ($u ? "text-decoration: underline;" : '') . "\n\t\t\t\t\t}\n\t\t\t\t";
}
for ($h = 1; $h <= 6; $h++) {
$fname = axiom_get_custom_option('typography_h' . $h . '_font');
if (isset($fonts[$fname])) {
$fstyle = explode(',', axiom_get_custom_option('typography_h' . $h . '_style'));
$fname2 = ($pos = axiom_strpos($fname, ' (')) !== false ? axiom_substr($fname, 0, $pos) : $fname;
$i = in_array('i', $fstyle);
$u = in_array('u', $fstyle);
$c = axiom_get_custom_option('typography_h' . $h . '_color');
$custom_style .= "\n\t\t\t\t\t\th" . intval($h) . ", .h" . intval($h) . " {\n\t\t\t\t\t\t\tfont-family: '" . esc_attr($fname2) . "'" . (isset($fonts[$fname]['family']) ? ", " . esc_attr($fonts[$fname]['family']) : '') . ";\n\t\t\t\t\t\t\tfont-size: " . esc_attr(axiom_get_custom_option('typography_h' . intval($h) . '_size')) . "px;\n\t\t\t\t\t\t\tfont-weight: " . esc_attr(axiom_get_custom_option('typography_h' . intval($h) . '_weight')) . ";\n\t\t\t\t\t\t\tline-height: " . esc_attr(axiom_get_custom_option('typography_h' . intval($h) . '_lineheight')) . "px;\n\t\t\t\t\t\t\t" . ($c ? "color: " . esc_attr($c) . ";" : '') . "\n\t\t\t\t\t\t\t" . ($i ? "font-style: italic;" : '') . "\n\t\t\t\t\t\t\t" . ($u ? "text-decoration: underline;" : '') . "\n\t\t\t\t\t\t}\n\t\t\t\t\t\th" . $h . " a, .h" . $h . " a {\n\t\t\t\t\t\t\t" . ($c ? "color: " . esc_attr($c) . ";" : '') . "\n\t\t\t\t\t\t}\n\t\t\t\t\t";
}
}
}
// Submenu width
$menu_width = axiom_get_theme_option('menu_width');
if (!empty($menu_width)) {
$custom_style .= "\n\t\t\t\t/* Submenu width */\n\t\t\t\t.menu_main_wrap .menu_main_nav > li ul {\n\t\t\t\t\twidth: " . intval($menu_width) . "px;\n\t\t\t\t}\n\t\t\t\t.menu_main_wrap .menu_main_nav > li > ul ul {\n\t\t\t\t\tleft:" . intval($menu_width + 4) . "px;\n\t\t\t\t}\n\t\t\t\t.menu_main_wrap .menu_main_nav > li > ul ul.submenu_left {\n\t\t\t\t\tleft:-" . intval($menu_width + 1) . "px;\n\t\t\t\t}\n\t\t\t";
}
// Logo height
$logo_height = axiom_get_custom_option('logo_height');
if (!empty($logo_height)) {
$custom_style .= "\n\t\t\t\t/* Logo header height */\n\t\t\t\t.menu_main_wrap .logo_main {\n\t\t\t\t\theight:" . intval($logo_height) . "px;\n\t\t\t\t}\n\t\t\t";
}
// Logo top offset
$logo_offset = axiom_get_custom_option('logo_offset');
if (!empty($logo_offset)) {
$custom_style .= "\n\t\t\t\t/* Logo header top offset */\n\t\t\t\t.menu_main_wrap .logo {\n\t\t\t\t\tmargin-top:" . intval($logo_offset) . "px;\n\t\t\t\t}\n\t\t\t";
}
// Logo footer height
$logo_height = axiom_get_theme_option('logo_footer_height');
if (!empty($logo_height)) {
$custom_style .= "\n\t\t\t\t/* Logo footer height */\n\t\t\t\t.contacts_wrap .logo img {\n\t\t\t\t\theight:" . intval($logo_height) . "px;\n\t\t\t\t}\n\t\t\t";
}
// Custom css from theme options
$custom_style .= axiom_get_custom_option('custom_css');
return $custom_style;
}
示例4: axiom_load_custom_options
function axiom_load_custom_options()
{
global $wp_query, $post, $AXIOM_GLOBALS;
$AXIOM_GLOBALS['custom_options'] = $AXIOM_GLOBALS['post_options'] = $AXIOM_GLOBALS['taxonomy_options'] = $AXIOM_GLOBALS['template_options'] = array();
// Load template options
$page_id = axiom_detect_template_page_id();
if ($page_id > 0) {
$AXIOM_GLOBALS['template_options'] = get_post_meta($page_id, 'post_custom_options', true);
}
// Load taxonomy and post options
$inheritance_key = axiom_detect_inheritance_key();
if (!empty($inheritance_key)) {
$inheritance = axiom_get_theme_inheritance($inheritance_key);
// Load taxonomy options
if (!empty($inheritance['taxonomy'])) {
foreach ($inheritance['taxonomy'] as $tax) {
$tax_obj = get_taxonomy($tax);
$tax_query = !empty($tax_obj->query_var) ? $tax_obj->query_var : $tax;
if ($tax == 'category' && is_category()) {
// Current page is category's archive (Categories need specific check)
$tax_id = (int) get_query_var('cat');
if (empty($tax_id)) {
$tax_id = get_query_var('category_name');
}
$AXIOM_GLOBALS['taxonomy_options'] = axiom_taxonomy_get_inherited_properties('category', $tax_id);
break;
} else {
if ($tax == 'post_tag' && is_tag()) {
// Current page is tag's archive (Tags need specific check)
$tax_id = get_query_var($tax_query);
$AXIOM_GLOBALS['taxonomy_options'] = axiom_taxonomy_get_inherited_properties('post_tag', $tax_id);
break;
} else {
if (is_tax($tax)) {
// Current page is custom taxonomy archive (All rest taxonomies check)
$tax_id = get_query_var($tax_query);
$AXIOM_GLOBALS['taxonomy_options'] = axiom_taxonomy_get_inherited_properties($tax, $tax_id);
break;
}
}
}
}
}
// Load post options
if (!empty($inheritance['post_type']) && is_singular() && (in_array(get_query_var('post_type'), $inheritance['post_type']) || !empty($post->post_type) && in_array($post->post_type, $inheritance['post_type']))) {
$post_id = get_the_ID();
$AXIOM_GLOBALS['post_options'] = get_post_meta($post_id, 'post_custom_options', true);
if (!empty($inheritance['taxonomy'])) {
$tax_list = array();
foreach ($inheritance['taxonomy'] as $tax) {
$tax_terms = axiom_get_terms_by_post_id(array('post_id' => $post_id, 'taxonomy' => $tax));
if (!empty($tax_terms[$tax]->terms)) {
$tax_list[] = axiom_taxonomies_get_inherited_properties($tax, $tax_terms[$tax]);
}
}
if (!empty($tax_list)) {
foreach ($tax_list as $tax_options) {
if (!empty($tax_options)) {
foreach ($tax_options as $tk => $tv) {
if (!isset($AXIOM_GLOBALS['taxonomy_options'][$tk]) || axiom_is_inherit_option($AXIOM_GLOBALS['taxonomy_options'][$tk])) {
$AXIOM_GLOBALS['taxonomy_options'][$tk] = $tv;
}
}
}
}
}
}
}
}
// Merge Template options with required for current page template
$layout_name = axiom_get_custom_option(is_singular() && !axiom_get_global('blog_streampage') ? 'single_style' : 'blog_style');
if (!empty($AXIOM_GLOBALS['registered_templates'][$layout_name]['theme_options'])) {
$AXIOM_GLOBALS['template_options'] = array_merge($AXIOM_GLOBALS['template_options'], $AXIOM_GLOBALS['registered_templates'][$layout_name]['theme_options']);
}
do_action('axiom_action_load_custom_options');
$AXIOM_GLOBALS['theme_options_loaded'] = true;
}
示例5: esc_url
">
<div class="content_wrap clearfix">
<div class="logo">
<a href="<?php
echo esc_url(home_url());
?>
"><?php
echo !empty($AXIOM_GLOBALS['logo_' . $logo_style]) ? '<img src="' . esc_url($AXIOM_GLOBALS['logo_' . $logo_style]) . '" class="logo_main" alt=""><img src="' . esc_url($AXIOM_GLOBALS['logo_fixed']) . '" class="logo_fixed" alt="">' : '';
echo $AXIOM_GLOBALS['logo_text'] ? '<span class="logo_text">' . $AXIOM_GLOBALS['logo_text'] . '</span>' : '';
echo $AXIOM_GLOBALS['logo_slogan'] ? '<span class="logo_slogan">' . esc_html($AXIOM_GLOBALS['logo_slogan']) . '</span>' : '';
?>
</a>
</div>
<?php
if (axiom_get_custom_option('show_search') == 'yes') {
echo do_shortcode('[trx_search open="no" title=""]');
}
?>
<a href="#" class="menu_main_responsive_button icon-menu-1"></a>
<nav role="navigation" class="menu_main_nav_area">
<?php
if (empty($AXIOM_GLOBALS['menu_main'])) {
$AXIOM_GLOBALS['menu_main'] = axiom_get_nav_menu('menu_main');
}
if (empty($AXIOM_GLOBALS['menu_main'])) {
$AXIOM_GLOBALS['menu_main'] = axiom_get_nav_menu();
}
echo $AXIOM_GLOBALS['menu_main'];
示例6: axiom_get_file_dir
<?php
}
?>
</div>
</div>
<?php
}
if (is_page('resource-centre-1')) {
require_once axiom_get_file_dir('templates/parts/resource-centre-top.php');
}
?>
<div class="page_content_wrap<?php
echo axiom_get_custom_option('custom_page_paddings') == 'no' ? '' : ' wrap_custom';
?>
"<?php
echo axiom_get_custom_option('show_page_top') == 'no' ? ' ' . trim($header_style) : '';
?>
>
<?php
// Content and sidebar wrapper
if (!is_singular(array('resource'))) {
if ($body_style != 'fullscreen') {
axiom_open_wrapper('<div class="content_wrap">');
}
}
if (!is_singular(array('resource'))) {
// Main content wrapper
axiom_open_wrapper('<div class="content">');
}
示例7: axiom_enqueue_slider
<?php
axiom_enqueue_slider();
$theme_skin = axiom_get_custom_option('theme_skin');
$color_scheme = axiom_get_custom_option('color_scheme');
if (empty($color_scheme)) {
$color_scheme = 'original';
}
$color_scheme_list = axiom_get_list_color_schemes();
$link_color = apply_filters('axiom_filter_get_link_color', axiom_get_custom_option('link_color'));
$menu_color = apply_filters('axiom_filter_get_menu_color', axiom_get_custom_option('menu_color'));
$user_color = apply_filters('axiom_filter_get_user_color', axiom_get_custom_option('user_color'));
$body_style = axiom_get_custom_option('body_style');
$bg_color = axiom_get_custom_option('bg_color');
$bg_pattern = axiom_get_custom_option('bg_pattern');
$bg_image = axiom_get_custom_option('bg_image');
$co_style = 'co_light';
//'co_dark';
?>
<div class="custom_options_shadow"></div>
<div id="custom_options" class="custom_options <?php
echo esc_attr($co_style);
?>
">
<a href="#" id="co_toggle" class="icon-gear-icon"></a>
<div class="co_header">
<div class="co_title">
<span><?php
示例8: axiom_template_excerpt_output
function axiom_template_excerpt_output($post_options, $post_data)
{
$show_title = true;
//!in_array($post_data['post_format'], array('aside', 'chat', 'status', 'link', 'quote'));
$tag = axiom_sc_in_shortcode_blogger(true) ? 'div' : 'article';
?>
<<?php
echo $tag;
?>
<?php
post_class('post_item post_item_excerpt post_featured_' . esc_attr($post_options['post_class']) . ' post_format_' . esc_attr($post_data['post_format']) . ($post_options['number'] % 2 == 0 ? ' even' : ' odd') . ($post_options['number'] == 0 ? ' first' : '') . ($post_options['number'] == $post_options['posts_on_page'] ? ' last' : '') . ($post_options['add_view_more'] ? ' viewmore' : ''));
?>
>
<?php
$post_icon = axiom_get_custom_option('show_post_icon') == 'yes' ? '<span class="post_icon ' . esc_attr($post_data['post_icon']) . '"></span>' : '';
?>
<?php
if ($post_data['post_flags']['sticky']) {
?>
<span class="sticky_label"></span><?php
}
if ($show_title && $post_options['location'] == 'center' && !empty($post_data['post_title'])) {
?>
<h3 class="post_title"><a href="<?php
echo esc_url($post_data['post_link']);
?>
"><?php
echo balanceTags($post_icon);
echo $post_data['post_title'];
?>
</a></h3><?php
}
if (!$post_data['post_protected'] && (!empty($post_options['dedicated']) || $post_data['post_thumb'] || $post_data['post_gallery'] || $post_data['post_video'] || $post_data['post_audio'])) {
?>
<div class="post_featured">
<?php
if (!empty($post_options['dedicated'])) {
echo $post_options['dedicated'];
} else {
if ($post_data['post_thumb'] || $post_data['post_gallery'] || $post_data['post_video'] || $post_data['post_audio']) {
require axiom_get_file_dir('templates/parts/post-featured.php');
}
}
?>
</div>
<?php
}
?>
<div class="post_content clearfix">
<?php
if ($show_title && $post_options['location'] != 'center' && !empty($post_data['post_title'])) {
?>
<h3 class="post_title"><a href="<?php
echo esc_url($post_data['post_link']);
?>
"><?php
echo balanceTags($post_icon);
echo $post_data['post_title'];
?>
</a></h3><?php
}
if (!$post_data['post_protected'] && $post_options['info']) {
require axiom_get_file_dir('templates/parts/post-info.php');
}
?>
<div class="post_descr">
<?php
if ($post_data['post_protected']) {
echo $post_data['post_excerpt'];
} else {
if ($post_data['post_excerpt']) {
echo in_array($post_data['post_format'], array('quote', 'link', 'chat', 'aside', 'status')) ? $post_data['post_excerpt'] : '<p>' . trim(axiom_strshort($post_data['post_excerpt'], isset($post_options['descr']) ? $post_options['descr'] : axiom_get_custom_option('post_excerpt_maxlength'))) . '</p>';
}
}
if (empty($post_options['readmore'])) {
$post_options['readmore'] = __('READ MORE', 'axiom');
}
if (!axiom_sc_param_is_off($post_options['readmore']) && !in_array($post_data['post_format'], array('quote', 'link', 'chat', 'aside', 'status'))) {
echo do_shortcode('[trx_button link="' . esc_url($post_data['post_link']) . '"]' . $post_options['readmore'] . '[/trx_button]');
}
?>
</div>
</div> <!-- /.post_content -->
</<?php
echo $tag;
?>
> <!-- /.post_item -->
<?php
}
示例9: axiom_get_custom_option
<?php
//===================================== Social sharing =====================================
$show_share = axiom_get_custom_option("show_share");
if (!axiom_sc_param_is_off($show_share)) {
$rez = axiom_show_share_links(array('post_id' => $post_data['post_id'], 'post_link' => $post_data['post_link'], 'post_title' => $post_data['post_title'], 'post_descr' => strip_tags($post_data['post_excerpt']), 'post_thumb' => $post_data['post_attachment'], 'type' => 'block', 'echo' => false));
if ($rez) {
?>
<div class="post_info post_info_bottom post_info_share post_info_share_<?php
echo esc_attr($show_share);
?>
"><?php
echo $rez;
?>
</div>
<?php
}
}
示例10: axiom_action_add_scripts_inline_education
function axiom_action_add_scripts_inline_education()
{
echo '<script type="text/javascript">' . 'jQuery(document).ready(function() {' . "if (AXIOM_GLOBALS['theme_font']=='') AXIOM_GLOBALS['theme_font'] = 'Roboto';" . "AXIOM_GLOBALS['link_color'] = '" . apply_filters('axiom_filter_get_link_color', axiom_get_custom_option('link_color')) . "';" . "AXIOM_GLOBALS['menu_color'] = '" . apply_filters('axiom_filter_get_menu_color', axiom_get_custom_option('menu_color')) . "';" . "AXIOM_GLOBALS['user_color'] = '" . apply_filters('axiom_filter_get_user_color', axiom_get_custom_option('user_color')) . "';" . "});" . "</script>";
}
示例11: axiom_sc_video
function axiom_sc_video($atts, $content = null)
{
if (axiom_sc_in_shortcode_blogger()) {
return '';
}
extract(axiom_sc_html_decode(shortcode_atts(array("url" => '', "src" => '', "image" => '', "ratio" => '16:9', "autoplay" => 'off', "align" => '', "bg_image" => '', "bg_top" => '', "bg_bottom" => '', "bg_left" => '', "bg_right" => '', "frame" => "on", "id" => "", "class" => "", "animation" => "", "css" => "", "width" => '', "height" => '', "top" => "", "bottom" => "", "left" => "", "right" => ""), $atts)));
$ratio = empty($ratio) ? "16:9" : str_replace(array('/', '\\', '-'), ':', $ratio);
$ratio_parts = explode(':', $ratio);
if (empty($height) && empty($width)) {
$width = '100%';
}
$ed = axiom_substr($width, -1);
if (empty($height) && !empty($width) && $ed != '%') {
$height = round($width / $ratio_parts[0] * $ratio_parts[1]);
}
if (!empty($height) && empty($width)) {
$width = round($height * $ratio_parts[0] / $ratio_parts[1]);
}
$css .= axiom_get_css_position_from_values($top, $right, $bottom, $left);
$css_dim = axiom_get_css_position_from_values('', '', '', '', $width, $height);
$css_bg = axiom_get_css_paddings_from_values($bg_top, $bg_right, $bg_bottom, $bg_left);
if ($src == '' && $url == '' && isset($atts[0])) {
$src = $atts[0];
}
$url = $src != '' ? $src : $url;
if ($image != '' && axiom_sc_param_is_off($image)) {
$image = '';
} else {
if (axiom_sc_param_is_on($autoplay) && is_single()) {
$image = '';
} else {
if ($image > 0) {
$attach = wp_get_attachment_image_src($image, 'full');
if (isset($attach[0]) && $attach[0] != '') {
$image = $attach[0];
}
}
if ($bg_image) {
$thumb_sizes = axiom_get_thumb_sizes(array('layout' => 'grid_3'));
$image = axiom_get_resized_image_url(empty($image) ? get_the_ID() : $image, $thumb_sizes['w'], $thumb_sizes['h'], null, false, false, false);
} else {
$image = axiom_get_resized_image_url(empty($image) ? get_the_ID() : $image, $ed != '%' ? $width : null, $height);
}
if (empty($image)) {
$image = axiom_get_video_cover_image($url);
}
}
}
if ($bg_image > 0) {
$attach = wp_get_attachment_image_src($bg_image, 'full');
if (isset($attach[0]) && $attach[0] != '') {
$bg_image = $attach[0];
}
}
if ($bg_image) {
$css_bg .= $css . 'background-image: url(' . esc_url($bg_image) . ');';
$css = $css_dim;
} else {
$css .= $css_dim;
}
$url = axiom_get_video_player_url($src != '' ? $src : $url);
$video = '<video' . ($id ? ' id="' . esc_attr($id) . '"' : '') . ' class="sc_video' . (!empty($class) ? ' ' . esc_attr($class) : '') . '"' . ' src="' . esc_url($url) . '"' . ' width="' . esc_attr($width) . '" height="' . esc_attr($height) . '"' . ' data-width="' . esc_attr($width) . '" data-height="' . esc_attr($height) . '"' . ' data-ratio="' . esc_attr($ratio) . '"' . ($image ? ' poster="' . esc_attr($image) . '" data-image="' . esc_attr($image) . '"' : '') . (!axiom_sc_param_is_off($animation) ? ' data-animation="' . esc_attr(axiom_sc_get_animation_classes($animation)) . '"' : '') . ($align && $align != 'none' ? ' data-align="' . esc_attr($align) . '"' : '') . ($bg_image ? ' data-bg-image="' . esc_attr($bg_image) . '"' : '') . ($css_bg != '' ? ' data-style="' . esc_attr($css_bg) . '"' : '') . ($css != '' ? ' style="' . esc_attr($css) . '"' : '') . ($image && axiom_get_theme_option('substitute_video') == 'yes' || axiom_sc_param_is_on($autoplay) && is_single() ? ' autoplay="autoplay"' : '') . ' controls="controls" loop="loop"' . '>' . '</video>';
if (axiom_get_custom_option('substitute_video') == 'no') {
if (axiom_sc_param_is_on($frame)) {
$video = axiom_get_video_frame($video, $image, $css, $css_bg);
}
} else {
if (isset($_GET['vc_editable']) && $_GET['vc_editable'] == 'true' && (isset($_POST['action']) && $_POST['action'] == 'vc_load_shortcode')) {
$video = axiom_substitute_video($video, $width, $height, false);
}
}
if (axiom_get_theme_option('use_mediaelement') == 'yes') {
axiom_enqueue_script('wp-mediaelement');
}
return apply_filters('axiom_shortcode_output', $video, 'trx_video', $atts, $content);
}
示例12: get_header
<?php
/**
Template Name: Attachment page
*/
get_header();
while (have_posts()) {
the_post();
// Move axiom_set_post_views to the javascript - counter will work under cache system
if (axiom_get_custom_option('use_ajax_views_counter') == 'no') {
axiom_set_post_views(get_the_ID());
}
axiom_show_post_layout(array('layout' => 'attachment', 'sidebar' => !axiom_sc_param_is_off(axiom_get_custom_option('show_sidebar_main'))));
}
get_footer();
示例13: axiom_get_custom_option
if (empty($slider_count)) {
$slider_count = 3;
}
}
$slider_interval = axiom_get_custom_option("slider_interval");
if ($slider_count > 0 || !empty($slider_ids)) {
$slider_html = do_shortcode('[trx_slider' . ' custom="no"' . ' crop="no"' . ' controls="0"' . ' engine="' . esc_attr($slider) . '"' . ' height="' . max(100, axiom_get_custom_option('slider_height')) . '"' . ' titles="' . esc_attr(axiom_get_custom_option("slider_infobox")) . '"' . ($slider_interval ? ' interval="' . esc_attr($slider_interval) . '"' : '') . ($slider_alias ? ' cat="' . esc_attr($slider_alias) . '"' : '') . ($slider_ids ? ' ids="' . esc_attr($slider_ids) . '"' : '') . ($slider_count ? ' count="' . esc_attr($slider_count) . '"' : '') . ($slider_orderby ? ' orderby="' . esc_attr($slider_orderby) . '"' : '') . ($slider_order ? ' order="' . esc_attr($slider_order) . '"' : '') . ($slider_pagination ? ' pagination="' . esc_attr($slider_pagination) . '"' : '') . '][/trx_slider]');
}
}
}
}
// if slider selected
if (!empty($slider_html)) {
?>
<section class="slider_wrap slider_<?php
echo esc_attr(axiom_get_custom_option('slider_display'));
?>
slider_engine_<?php
echo esc_attr($slider);
?>
slider_alias_<?php
echo esc_attr($slider_alias);
?>
">
<?php
echo $slider_html;
?>
</section>
<?php
}
}
示例14: foreach
if (!empty($post_data['post_terms'][$post_data['post_taxonomy']]->terms)) {
foreach ($post_data['post_terms'][$post_data['post_taxonomy']]->terms as $cat) {
$id = (int) $cat->term_id;
$prop = axiom_taxonomy_get_inherited_property($post_data['post_taxonomy'], $id, 'reviews_criterias');
if (!empty($prop) && !axiom_is_inherit_option($prop)) {
$field['options'] = $prop;
break;
}
}
}
// Author marks
if ($reviews_first_author || !$reviews_second_hide) {
$field["id"] = "reviews_marks_author";
$field["descr"] = strip_tags($post_data['post_excerpt']);
$field["accept"] = false;
$marks = axiom_reviews_marks_to_display(axiom_reviews_marks_prepare(axiom_get_custom_option('reviews_marks'), count($field['options'])));
$output .= '<div id="author_marks" class="sc_tabs_content">' . trim(axiom_reviews_get_markup($field, $marks, false, false, $reviews_first_author)) . '</div>';
}
// Users marks
if (!$reviews_first_author || !$reviews_second_hide) {
$marks = axiom_reviews_marks_to_display(axiom_reviews_marks_prepare(get_post_meta($post_data['post_id'], 'reviews_marks2', true), count($field['options'])));
$users = max(0, get_post_meta($post_data['post_id'], 'reviews_users', true));
$field["id"] = "reviews_marks_users";
$field["descr"] = sprintf(__("Summary rating from <b>%s</b> user's marks.", 'axiom'), $users) . ' ' . (!isset($_COOKIE['axiom_votes']) || axiom_strpos($_COOKIE['axiom_votes'], ',' . $post_data['post_id'] . ',') === false ? __('You can set own marks for this article - just click on stars above and press "Accept".', 'axiom') : __('Thanks for your vote!', 'axiom'));
$field["accept"] = $allow_user_marks;
$output .= '<div id="users_marks" class="sc_tabs_content"' . (!$output ? ' style="display: block;"' : '') . '>' . trim(axiom_reviews_get_markup($field, $marks, $allow_user_marks, false, !$reviews_first_author)) . '</div>';
}
$reviews_markup .= $output . '</div>';
if ($allow_user_marks) {
axiom_enqueue_script('jquery-ui-draggable', false, array('jquery', 'jquery-ui-core'), null, true);
$reviews_markup .= '
示例15: axiom_template_attachment_output
function axiom_template_attachment_output($post_options, $post_data)
{
$post_data['post_views']++;
$title_tag = axiom_get_custom_option('show_page_top') == 'yes' && axiom_get_custom_option('show_page_title') == 'yes' ? 'h3' : 'h1';
?>
<article <?php
post_class('post_item post_item_attachment template_attachment');
?>
>
<?php
$post_icon = axiom_get_custom_option('show_post_icon') == 'yes' ? '<span class="post_icon ' . esc_attr($post_data['post_icon']) . '"></span>' : '';
?>
<<?php
echo esc_html($title_tag);
?>
class="post_title"><?php
echo balanceTags($post_icon);
echo !empty($post_data['post_excerpt']) ? strip_tags($post_data['post_excerpt']) : $post_data['post_title'];
?>
</<?php
echo esc_html($title_tag);
?>
>
<div class="post_featured">
<div class="post_thumb post_nav" data-image="<?php
echo esc_url($post_data['post_attachment']);
?>
" data-title="<?php
echo esc_attr($post_data['post_title']);
?>
">
<?php
echo $post_data['post_thumb'];
$post = get_post();
$attachments = array_values(get_children(array('post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID')));
foreach ($attachments as $k => $attachment) {
if ($attachment->ID == $post->ID) {
break;
}
}
if (isset($attachments[$k - 1])) {
$link = get_permalink($attachments[$k - 1]->ID) . '#top_of_page';
$desc = axiom_strshort(!empty($attachments[$k - 1]->post_excerpt) ? $attachments[$k - 1]->post_excerpt : $attachments[$k - 1]->post_title, 30);
?>
<a class="post_nav_item post_nav_prev" href="<?php
echo esc_url($link);
?>
">
<span class="post_nav_info">
<span class="post_nav_info_title"><?php
_e('Previous item', 'axiom');
?>
</span>
<span class="post_nav_info_description"><?php
echo $desc;
?>
</span>
</span>
</a>
<?php
}
if (isset($attachments[$k + 1])) {
$link = get_permalink($attachments[$k + 1]->ID) . '#top_of_page';
$desc = axiom_strshort(!empty($attachments[$k + 1]->post_excerpt) ? $attachments[$k + 1]->post_excerpt : $attachments[$k + 1]->post_title, 30);
?>
<a class="post_nav_item post_nav_next" href="<?php
echo esc_url($link);
?>
">
<span class="post_nav_info">
<span class="post_nav_info_title"><?php
_e('Next item', 'axiom');
?>
</span>
<span class="post_nav_info_description"><?php
echo $desc;
?>
</span>
</span>
</a>
<?php
}
?>
</div>
</div>
<?php
if (!$post_data['post_protected'] && axiom_get_custom_option('show_post_info') == 'yes') {
require axiom_get_file_dir('templates/parts/post-info.php');
}
?>
<div class="post_content">
<?php
// Post content
if ($post_data['post_protected']) {
echo $post_data['post_excerpt'];
//.........这里部分代码省略.........