Exemplo n.º 1
0
function axiom_facebook_og_tags()
{
    global $post;
    if (!is_singular() || axiom_get_global('blog_streampage')) {
        return;
    }
    if (has_post_thumbnail($post->ID)) {
        $thumbnail_src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');
        echo '<meta property="og:image" content="' . esc_attr($thumbnail_src[0]) . '"/>' . "\n";
    }
    //echo '<meta property="og:title" content="' . esc_attr( strip_tags( get_the_title() ) ) . '" />' . "\n"
    //	.'<meta property="og:description" content="' . esc_attr( strip_tags( strip_shortcodes( get_the_excerpt()) ) ) . '" />' . "\n"
    //	.'<meta property="og:url" content="' . esc_attr( get_permalink() ) . '" />';
}
Exemplo n.º 2
0
<?php

/**
 * The Header for our theme.
 */
global $AXIOM_GLOBALS;
// Theme init - don't remove next row! Load custom options
axiom_core_init_theme();
$theme_skin = axiom_esc(axiom_get_custom_option('theme_skin'));
$blog_style = axiom_get_custom_option(is_singular() && !axiom_get_global('blog_streampage') ? 'single_style' : 'blog_style');
$body_style = axiom_get_custom_option('body_style');
$logo_style = axiom_get_custom_option('top_panel_style');
$article_style = axiom_get_custom_option('article_style');
$top_panel_style = axiom_get_custom_option('top_panel_style');
$top_panel_opacity = axiom_get_custom_option('top_panel_opacity');
$top_panel_position = axiom_get_custom_option('top_panel_position');
$video_bg_show = axiom_get_custom_option('show_video_bg') == 'yes' && (axiom_get_custom_option('video_bg_youtube_code') != '' || axiom_get_custom_option('video_bg_url') != '');
?>
<!DOCTYPE html>
<html <?php 
language_attributes();
?>
>
<head>
	<meta charset="<?php 
bloginfo('charset');
?>
" />
	<?php 
if (axiom_get_theme_option('responsive_layouts') == 'yes') {
    ?>
Exemplo n.º 3
0
 function axiom_core_frontend_scripts()
 {
     global $wp_styles, $AXIOM_GLOBALS;
     // Enqueue styles
     //-----------------------------------------------------------------------------------------------------
     // Prepare custom fonts
     $fonts = axiom_get_list_fonts(false);
     $theme_fonts = array();
     if (axiom_get_custom_option('typography_custom') == 'yes') {
         $selectors = array('p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6');
         foreach ($selectors as $s) {
             $font = axiom_get_custom_option('typography_' . $s . '_font');
             if (!empty($font)) {
                 $theme_fonts[$font] = 1;
             }
         }
     }
     // Prepare current skin fonts
     $theme_fonts = apply_filters('axiom_filter_used_fonts', $theme_fonts);
     // Link to selected fonts
     foreach ($theme_fonts as $font => $v) {
         if (isset($fonts[$font])) {
             $font_name = ($pos = axiom_strpos($font, ' (')) !== false ? axiom_substr($font, 0, $pos) : $font;
             $css = !empty($fonts[$font]['css']) ? $fonts[$font]['css'] : 'http://fonts.googleapis.com/css?family=' . (!empty($fonts[$font]['link']) ? $fonts[$font]['link'] : str_replace(' ', '+', $font_name) . ':100,100italic,300,300italic,400,400italic,700,700italic') . (empty($fonts[$font]['link']) || axiom_strpos($fonts[$font]['link'], 'subset=') === false ? '&subset=latin,latin-ext,cyrillic,cyrillic-ext' : '');
             axiom_enqueue_style('theme-font-' . str_replace(' ', '-', $font_name), $css, array(), null);
         }
     }
     // Fontello styles must be loaded before main stylesheet
     axiom_enqueue_style('axiom-fontello-style', axiom_get_file_url('css/fontello/css/fontello.css'), array(), null);
     //axiom_enqueue_style( 'axiom-fontello-animation-style', axiom_get_file_url('css/fontello/css/animation.css'), array(), null);
     // Main stylesheet
     axiom_enqueue_style('axiom-main-style', get_stylesheet_uri(), array(), null);
     if (axiom_get_theme_option('debug_mode') == 'no' && axiom_get_theme_option('packed_scripts') == 'yes' && file_exists(axiom_get_file_dir('css/__packed.css'))) {
         // Load packed styles
         axiom_enqueue_style('axiom-packed-style', axiom_get_file_url('css/__packed.css'), array(), null);
     } else {
         // Shortcodes
         axiom_enqueue_style('axiom-shortcodes-style', axiom_get_file_url('shortcodes/shortcodes.css'), array(), null);
         // Animations
         if (axiom_get_theme_option('css_animation') == 'yes') {
             axiom_enqueue_style('axiom-animation-style', axiom_get_file_url('css/core.animation.css'), array(), null);
         }
     }
     // Theme skin stylesheet
     do_action('axiom_action_add_styles');
     // Theme customizer stylesheet and inline styles
     axiom_enqueue_custom_styles();
     // Responsive
     if (axiom_get_theme_option('responsive_layouts') == 'yes') {
         axiom_enqueue_style('axiom-responsive-style', axiom_get_file_url('css/responsive.css'), array(), null);
         do_action('axiom_action_add_responsive');
         if (axiom_get_custom_option('theme_skin') != '') {
             $css = apply_filters('axiom_filter_add_responsive_inline', '');
             if (!empty($css)) {
                 wp_add_inline_style('axiom-responsive-style', $css);
             }
         }
     }
     // Enqueue scripts
     //----------------------------------------------------------------------------------------------------------------------------
     if (axiom_get_theme_option('debug_mode') == 'no' && axiom_get_theme_option('packed_scripts') == 'yes' && file_exists(axiom_get_file_dir('js/__packed.js'))) {
         // Load packed theme scripts
         axiom_enqueue_script('axiom-packed-scripts', axiom_get_file_url('js/__packed.js'), array('jquery'), null, true);
     } else {
         // Load separate theme scripts
         axiom_enqueue_script('superfish', axiom_get_file_url('js/superfish.min.js'), array('jquery'), null, true);
         if (axiom_get_theme_option('menu_slider') == 'yes') {
             axiom_enqueue_script('axiom-slidemenu-script', axiom_get_file_url('js/jquery.slidemenu.js'), array('jquery'), null, true);
             //axiom_enqueue_script( 'axiom-jquery-easing-script', axiom_get_file_url('js/jquery.easing.js'), array('jquery'), null, true );
         }
         // Load this script only if any shortcode run
         //axiom_enqueue_script( 'axiom-shortcodes-script', axiom_get_file_url('shortcodes/shortcodes.js'), array('jquery'), null, true );
         if (is_single() && axiom_get_custom_option('show_reviews') == 'yes') {
             axiom_enqueue_script('axiom-core-reviews-script', axiom_get_file_url('js/core.reviews.js'), array('jquery'), null, true);
         }
         axiom_enqueue_script('axiom-core-utils-script', axiom_get_file_url('js/core.utils.js'), array('jquery'), null, true);
         axiom_enqueue_script('axiom-core-init-script', axiom_get_file_url('js/core.init.js'), array('jquery'), null, true);
     }
     // Media elements library
     if (axiom_get_theme_option('use_mediaelement') == 'yes') {
         wp_enqueue_style('mediaelement');
         wp_enqueue_style('wp-mediaelement');
         wp_enqueue_script('mediaelement');
         wp_enqueue_script('wp-mediaelement');
     } else {
         global $wp_scripts;
         $wp_scripts->done[] = 'mediaelement';
         $wp_scripts->done[] = 'wp-mediaelement';
         $wp_styles->done[] = 'mediaelement';
         $wp_styles->done[] = 'wp-mediaelement';
     }
     // Video background
     if (axiom_get_custom_option('show_video_bg') == 'yes' && axiom_get_custom_option('video_bg_youtube_code') != '') {
         axiom_enqueue_script('axiom-video-bg-script', axiom_get_file_url('js/jquery.tubular.1.0.js'), array('jquery'), null, true);
     }
     // Google map
     if (axiom_get_custom_option('show_googlemap') == 'yes') {
         axiom_enqueue_script('googlemap', 'http://maps.google.com/maps/api/js?sensor=false', array(), null, true);
         axiom_enqueue_script('axiom-googlemap-script', axiom_get_file_url('js/core.googlemap.js'), array(), null, true);
     }
     // Social share buttons
     if (is_singular() && !axiom_get_global('blog_streampage') && axiom_get_custom_option('show_share') != 'hide') {
         axiom_enqueue_script('axiom-social-share-script', axiom_get_file_url('js/social/social-share.js'), array('jquery'), null, true);
     }
     // Comments
     if (is_singular() && !axiom_get_global('blog_streampage') && comments_open() && get_option('thread_comments')) {
         axiom_enqueue_script('comment-reply', false, array(), null, true);
     }
     // Custom panel
     if (axiom_get_custom_option('show_theme_customizer') == 'yes') {
         if (file_exists(axiom_get_file_dir('core/core.customizer/front.customizer.css'))) {
             axiom_enqueue_style('axiom-customizer-style', axiom_get_file_url('core/core.customizer/front.customizer.css'), array(), null);
         }
         if (file_exists(axiom_get_file_dir('core/core.customizer/front.customizer.js'))) {
             axiom_enqueue_script('axiom-customizer-script', axiom_get_file_url('core/core.customizer/front.customizer.js'), array(), null, true);
         }
     }
     //Debug utils
     if (axiom_get_theme_option('debug_mode') == 'yes') {
         axiom_enqueue_script('axiom-core-debug-script', axiom_get_file_url('js/core.debug.js'), array(), null, true);
     }
     // Theme skin script
     do_action('axiom_action_add_scripts');
 }
Exemplo n.º 4
0
 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;
 }
Exemplo n.º 5
0
 function axiom_get_post_data(&$opt, $post_obj = null)
 {
     $opt = axiom_get_post_data_options($opt);
     global $post, $wp_query;
     $old_post = null;
     if (!empty($post) && is_object($post)) {
         $old_post = clone $post;
     }
     if ($post_obj != null) {
         $post = $post_obj;
         setup_postdata($post);
     }
     $cur_post = clone $post;
     $post_id = get_the_ID();
     $post_parent_id = wp_get_post_parent_id($post_id);
     if (!$post_parent_id) {
         $post_parent_id = 0;
     }
     $post_type = get_post_type();
     $post_protected = post_password_required();
     $post_format = get_post_format();
     if (empty($post_format)) {
         $post_format = 'standard';
     }
     $post_icon = axiom_get_custom_option('icon', axiom_get_post_format_icon($post_format), $post_id, $post_type);
     //!!!!! Get option from specified post
     $post_flags = array('sticky' => is_sticky());
     $post_link = get_permalink();
     $post_comments_link = get_comments_link();
     $post_date_sql = get_the_date('Y-m-d H:i:s');
     $post_date_stamp = get_the_date('U');
     $post_date = axiom_get_date_or_difference($post_date_sql);
     if (!empty($opt['date_format'])) {
         $parts = explode('+', $opt['date_format']);
         $post_date_part1 = empty($parts[0]) ? '' : date($parts[0], $post_date_stamp);
         $post_date_part2 = empty($parts[1]) ? '' : date($parts[1], $post_date_stamp);
         if ($post_date_part1 . $post_date_part2 != '') {
             $post_date = $post_date_part1 . ($post_date_part2 != '' ? ' ' . $post_date_part2 : '');
         }
     }
     $post_comments = $post_views = $post_likes = 0;
     if ($opt['counters'] != '') {
         $post_comments = get_comments_number();
         $post_views = axiom_get_post_views($post_id);
         $post_likes = axiom_get_post_likes($post_id);
     }
     $post_reviews_author = $post_reviews_users = 0;
     if ($opt['reviews']) {
         $post_reviews_author = axiom_reviews_marks_to_display(get_post_meta($post_id, 'reviews_avg', true));
         $post_reviews_users = axiom_reviews_marks_to_display(get_post_meta($post_id, 'reviews_avg2', true));
     }
     $post_author = get_the_author();
     $post_author_id = get_the_author_meta('ID');
     $post_author_url = get_author_posts_url($post_author_id, '');
     // Is user can edit and/or delete this post?
     $allow_editor = axiom_get_theme_option("allow_editor") == 'yes';
     $post_edit_enable = $allow_editor && ($post_type == 'post' && current_user_can('edit_posts', $post_id) || $post_type == 'page' && current_user_can('edit_pages', $post_id));
     $post_delete_enable = $allow_editor && ($post_type == 'post' && current_user_can('delete_posts', $post_id) || $post_type == 'page' && current_user_can('delete_pages', $post_id));
     // Post content
     global $more;
     $old_more = $more;
     $more = -1;
     $post_content_original = trim(chop($post->post_content));
     $post_content_plain = trim(chop(get_the_content()));
     $more = $old_more;
     $post_content = trim(chop(get_the_content($opt['more_tag'], $opt['strip_teaser'])));
     // Substitute WP [gallery] shortcode
     $thumb_sizes = axiom_get_thumb_sizes(array('layout' => $opt['layout']));
     if ($opt['content']) {
         if ($opt['substitute_gallery']) {
             $post_content = axiom_substitute_gallery($post_content, $post_id, $thumb_sizes['w'], $thumb_sizes['h_crop'], 'none', true);
         }
         $post_content = apply_filters('the_content', $post_content);
         if ($post_id != get_the_ID()) {
             // Fix bug in the WPML
             $post = $cur_post;
             setup_postdata($post);
         }
         if ($opt['substitute_video']) {
             $post_content = axiom_substitute_video($post_content, $thumb_sizes['w'], $thumb_sizes['h_crop']);
         }
         if ($opt['substitute_audio']) {
             $post_content = axiom_substitute_audio($post_content);
         }
     }
     // Post excerpt
     $post_excerpt_original = $post->post_excerpt;
     $post_excerpt = has_excerpt() || $post_protected ? get_the_excerpt() : '';
     if (empty($post_excerpt)) {
         if (($more_pos = axiom_strpos($post_content_plain, '<span id="more-')) !== false) {
             $post_excerpt = axiom_substr($post_content_plain, 0, $more_pos);
         } else {
             $post_excerpt = in_array($post_format, array('quote', 'link')) ? $post_content : strip_shortcodes(strip_tags(get_the_excerpt()));
         }
     }
     if ($opt['substitute_gallery']) {
         $post_excerpt = axiom_substitute_gallery($post_excerpt, $post_id, $thumb_sizes['w'], $thumb_sizes['h_crop']);
     }
     $post_excerpt = apply_filters('axiom_filter_sc_clear_around', $post_excerpt);
     $post_excerpt = apply_filters('the_excerpt', $post_excerpt);
     $post_excerpt = apply_filters('axiom_filter_p_clear_around', $post_excerpt);
     if ($post_id != get_the_ID()) {
         // Fix bug in the WPML
         $post = $cur_post;
         setup_postdata($post);
     }
     if ($opt['substitute_video']) {
         $post_excerpt = axiom_substitute_video($post_excerpt, $thumb_sizes['w'], $thumb_sizes['h_crop']);
     }
     if ($opt['substitute_audio']) {
         $post_excerpt = axiom_substitute_audio($post_excerpt);
     }
     $post_excerpt = trim(chop(str_replace(array('[...]', '[&hellip;]'), array('', ''), $post_excerpt)));
     // Post Title
     $post_title = $post_title_plain = trim(chop(get_the_title()));
     $post_title = apply_filters('the_title', $post_title);
     if ($post_id != get_the_ID()) {
         // Fix bug in the WPML
         $post = $cur_post;
         setup_postdata($post);
     }
     // Prepare dedicated content
     $opt['dedicated'] = axiom_sc_get_dedicated_content();
     $opt['location'] = !empty($opt['location']) ? $opt['location'] : axiom_get_custom_option('dedicated_location');
     if (empty($opt['location']) || $opt['location'] == 'default') {
         $opt['location'] = axiom_get_custom_option('dedicated_location', '', $post_id, $post_type);
     }
     //!!!!! Get option from specified post
     if ($opt['location'] == 'alter' && !is_single() && (!is_page() || isset($wp_query->is_posts_page) && $wp_query->is_posts_page == 1)) {
         $loc = array('center', 'right', 'left');
         $opt['location'] = $loc[($opt['number'] - 1) % count($loc)];
     }
     if (!empty($opt['dedicated'])) {
         $class = axiom_get_tag_attrib($opt['dedicated'], '<div class="sc_section>', 'class');
         if ($opt['location'] == 'default') {
             if (($pos = axiom_strpos($class, 'sc_align')) !== false) {
                 $pos += 8;
                 $pos2 = axiom_strpos($class, ' ', $pos);
                 $opt['location'] = $pos2 === false ? axiom_substr($class, $pos) : axiom_substr($class, $pos, $pos2 - $pos);
             }
             if ($opt['location'] == '' || $opt['location'] == 'default') {
                 $opt['location'] = 'center';
             }
         }
         if (!is_singular() || axiom_get_global('blog_streampage') || axiom_sc_in_shortcode_blogger(true) || axiom_strpos($class, 'sc_align') !== false && axiom_strpos($class, 'columns') === false) {
             $class = str_replace(array('sc_alignright', 'sc_alignleft', 'sc_aligncenter'), array('', '', ''), $class) . ' sc_align' . esc_attr($opt['location']);
             //if ($opt['location'] == 'center' && axiom_strpos($class, 'column-2_3')===false && $opt['sidebar'])
             //	$class = str_replace('columns', '_columns', $class) . ' column-2_3';
             //else if (($opt['location'] == 'left' || $opt['location'] == 'right') && axiom_strpos($class, 'column-1_2')===false)// && $opt['sidebar'])
             //	$class = str_replace('columns', '_columns', $class) . ' column-1_2';
             $opt['dedicated'] = axiom_set_tag_attrib($opt['dedicated'], '<div class="sc_section>', 'class', $class);
         }
     }
     //else if ($opt['location']=='' || $opt['location']=='default')
     //$opt['location'] = 'center';
     //if ($opt['location']=='default') $opt['location']='center';
     $opt['post_class'] = $opt['location'];
     // Substitute <video> tags to <iframe> in dedicated content
     if ($opt['substitute_video']) {
         $opt['dedicated'] = axiom_substitute_video($opt['dedicated'], $thumb_sizes['w'], $thumb_sizes['h_crop']);
     }
     // Substitute <audio> tags with src from soundcloud to <iframe>
     if ($opt['substitute_audio']) {
         $opt['dedicated'] = axiom_substitute_audio($opt['dedicated']);
     }
     // Extract gallery, video and audio from full post content
     $post_thumb = $post_thumb_url = $post_attachment = $post_gallery = $post_video = $post_video_image = $post_audio = $post_audio_image = $post_url = $post_url_target = '';
     $post_attachment = wp_get_attachment_url(get_post_thumbnail_id($post_id));
     if (axiom_substr($opt['layout'], 0, 6) == 'single') {
         $post_thumb = axiom_get_resized_image_tag($post_id, $thumb_sizes['w'], $thumb_sizes['h'], null, false, false, true);
     } else {
         if (axiom_substr($opt['layout'], 0, 10) == 'attachment') {
             $post_thumb = axiom_get_resized_image_tag($post_attachment, $thumb_sizes['w'], $thumb_sizes['h'], null, false, false, true);
         } else {
             $post_thumb = axiom_get_resized_image_tag($post_id, $thumb_sizes['w'], $post_type == 'product' && axiom_get_theme_option('crop_product_thumb') == 'no' ? null : $thumb_sizes['h']);
         }
     }
     $post_thumb_url = axiom_get_tag_attrib($post_thumb, '<img>', 'src');
     if ($post_format == 'gallery') {
         $post_gallery = axiom_build_gallery_tag(axiom_get_post_gallery($post_content_plain, $post_id, max(2, axiom_get_custom_option('gallery_max_slides'))), $thumb_sizes['w'], $thumb_sizes['h_crop'], false, $post_link);
     } else {
         if ($post_format == 'video') {
             $src = '';
             $post_video = axiom_get_post_video($post_content_original, false);
             if ($post_video == '') {
                 $src = axiom_get_post_video($post_content_original, true);
                 if (!axiom_is_youtube_url($src) && !axiom_is_vimeo_url($src)) {
                     $src = '';
                 }
             } else {
                 if (axiom_substr($post_video, 0, 1) == '[') {
                     $src = axiom_get_tag_attrib($post_video, '[trx_video]', 'src');
                     if (empty($src)) {
                         $src = axiom_get_tag_attrib($post_video, '[trx_video]', 'url');
                     }
                     if (empty($src)) {
                         $src = axiom_get_post_video($post_video, true);
                     }
                     $post_video_image = axiom_get_tag_attrib($post_video, '[trx_video]', 'image');
                     if ($post_video_image > 0) {
                         $attach = wp_get_attachment_image_src($post_video_image, 'full');
                         if (isset($attach[0]) && $attach[0] != '') {
                             $post_video_image = $attach[0];
                         }
                     }
                     if (empty($post_video_image)) {
                         $post_video_image = axiom_get_video_cover_image($src);
                     }
                     if (empty($post_video_image)) {
                         $post_video_image = $post_thumb;
                     }
                     $post_video_image = axiom_get_resized_image_tag($post_video_image, $thumb_sizes['w'], $thumb_sizes['h']);
                 } else {
                     $src = axiom_get_post_video($post_video, true);
                 }
             }
             if ($src) {
                 $src = axiom_get_video_player_url($src, $post_thumb != '' || $post_video_image != '');
                 $post_video = '<video src="' . esc_url($src) . '" width="' . esc_attr($thumb_sizes['w']) . '" height="' . round($thumb_sizes['w'] / 16 * 9) . '"></video>';
             }
             if ($post_video != '' && $opt['substitute_video']) {
                 $post_video = axiom_substitute_video($post_video, $thumb_sizes['w'], round($thumb_sizes['w'] / 16 * 9), false);
                 //$thumb_sizes['h_crop']);
             }
         } else {
             if ($post_format == 'audio') {
                 $src = $data = '';
                 $post_audio = axiom_get_post_audio($post_content_original, false);
                 if ($post_audio == '') {
                     $src = axiom_get_post_audio($post_content_original, true);
                 } else {
                     if (axiom_substr($post_audio, 0, 1) == '[') {
                         $src = axiom_get_tag_attrib($post_audio, '[trx_audio]', 'src');
                         if (empty($src)) {
                             $src = axiom_get_tag_attrib($post_audio, '[trx_audio]', 'url');
                         }
                         if (empty($src)) {
                             $src = axiom_get_post_audio($post_audio, true);
                         }
                         $post_audio_image = axiom_get_tag_attrib($post_audio, '[trx_audio]', 'image');
                         if ($post_audio_image > 0) {
                             $attach = wp_get_attachment_image_src($post_audio_image, 'full');
                             if (isset($attach[0]) && $attach[0] != '') {
                                 $post_audio_image = $attach[0];
                             }
                         }
                         if (empty($post_audio_image)) {
                             $post_audio_image = $post_thumb;
                         }
                         if ($post_audio_image) {
                             $post_audio_image = axiom_get_resized_image_url($post_audio_image, $thumb_sizes['w'], $thumb_sizes['h']);
                         }
                         $post_audio_title = axiom_get_tag_attrib($post_audio, '[trx_audio]', 'title');
                         $post_audio_author = axiom_get_tag_attrib($post_audio, '[trx_audio]', 'author');
                         $data = ($post_audio_title != '' ? ' data-title="' . esc_attr($post_audio_title) . '"' : '') . ($post_audio_author != '' ? ' data-author="' . esc_attr($post_audio_author) . '"' : '') . ($post_audio_image != '' ? ' data-image="' . esc_attr($post_audio_image) . '"' : '');
                     } else {
                         $src = axiom_get_post_audio($post_audio, true);
                     }
                 }
                 if ($src) {
                     $post_audio = '<audio class="sc_audio" src="' . esc_url($src) . '"' . $data . '></audio>';
                 }
                 if ($post_audio != '' && $opt['substitute_audio'] == 'yes') {
                     $post_audio = axiom_substitute_audio($post_audio, false);
                 }
             }
         }
     }
     if ($post_format == 'image' && !$post_thumb && !is_single()) {
         if (($src = axiom_get_post_image($post_content_original, $post_id)) != '') {
             $post_thumb = axiom_get_resized_image_tag($src, $thumb_sizes['w'], $thumb_sizes['h_crop']);
         }
     }
     if ($post_format == 'link') {
         $post_url_data = axiom_get_post_link($post_content_original, false);
         $post_link = $post_url = $post_url_data['url'];
         $post_url_target = $post_url_data['target'];
     }
     // Get all post's terms
     $post_taxonomy = axiom_get_taxonomy_categories_by_post_type($post_type);
     $post_taxonomy_tags = axiom_get_taxonomy_tags_by_post_type($post_type);
     $post_terms = array();
     if ($opt['terms_list']) {
         $post_terms = axiom_get_terms_by_post_id(array('post_id' => $post_id, 'parent_id' => $post_type == 'post' ? $opt['parent_tax_id'] : 0, 'exclude' => $post_type == 'post' ? explode(',', axiom_get_theme_option('exclude_cats')) : array()));
     }
     if ($old_post != null) {
         $post = $old_post;
         setup_postdata($post);
     }
     $post_data = compact('post_id', 'post_parent_id', 'post_protected', 'post_type', 'post_taxonomy', 'post_taxonomy_tags', 'post_format', 'post_flags', 'post_icon', 'post_link', 'post_comments_link', 'post_date_sql', 'post_date_stamp', 'post_date', 'post_date_part1', 'post_date_part2', 'post_comments', 'post_views', 'post_likes', 'post_reviews_author', 'post_reviews_users', 'post_author', 'post_author_id', 'post_author_url', 'post_title', 'post_title_plain', 'post_content_plain', 'post_content_original', 'post_content', 'post_excerpt_original', 'post_excerpt', 'post_thumb', 'post_thumb_url', 'post_attachment', 'post_gallery', 'post_video', 'post_video_image', 'post_audio', 'post_audio_image', 'post_url', 'post_url_target', 'post_terms', 'post_edit_enable', 'post_delete_enable');
     return apply_filters('axiom_filter_get_post_data', $post_data, $opt, $post_obj);
 }
Exemplo n.º 6
0
 function axiom_woocommerce_the_title($title)
 {
     if (axiom_get_global('in_product_item') && get_post_type() == 'product') {
         $title = '<a href="' . get_permalink() . '">' . $title . '</a>';
     }
     return $title;
 }