function x_customizer_generated_css_output() { $outp_path = X_TEMPLATE_PATH . '/framework/functions/global/admin/customizer/output'; require_once $outp_path . '/variables.php'; ob_start(); echo '<style id="x-customizer-css-output" type="text/css">'; require_once $outp_path . '/' . x_get_stack() . '.php'; require_once $outp_path . '/base.php'; require_once $outp_path . '/masthead.php'; require_once $outp_path . '/buttons.php'; require_once $outp_path . '/widgets.php'; require_once $outp_path . '/bbpress.php'; require_once $outp_path . '/buddypress.php'; require_once $outp_path . '/gravity-forms.php'; do_action('x_head_css'); echo '</style>'; $css = ob_get_contents(); ob_end_clean(); // // 1. Remove comments. // 2. Remove whitespace. // 3. Remove starting whitespace. // $output = preg_replace('#/\\*.*?\\*/#s', '', $css); // 1 $output = preg_replace('/\\s*([{}|:;,])\\s+/', '$1', $output); // 2 $output = preg_replace('/\\s\\s+(.*)/', '$1', $output); // 3 echo $output; }
function x_add_post_meta_boxes() { $meta_box = array('id' => 'x-meta-box-post', 'title' => __('Post Settings', '__x__'), 'description' => __('Here you will find various options you can use to create different page styles.', '__x__'), 'page' => 'post', 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Body CSS Class(es)', '__x__'), 'desc' => __('Add a custom CSS class to the <body> element. Separate multiple class names with a space.', '__x__'), 'id' => '_x_entry_body_css_class', 'type' => 'text', 'std' => ''), array('name' => __('Fullwidth Post Layout', '__x__'), 'desc' => __('If your global content layout includes a sidebar, selecting this option will remove the sidebar for this post.', '__x__'), 'id' => '_x_post_layout', 'type' => 'checkbox', 'std' => ''), array('name' => __('Alternate Index Title', '__x__'), 'desc' => __('Filling out this text input will replace the standard title on all index pages (i.e. blog, category archives, search, et cetera) with this one.', '__x__'), 'id' => '_x_entry_alternate_index_title', 'type' => 'text', 'std' => ''), array('name' => __('Background Image(s)', '__x__'), 'desc' => __('Click the button to upload your background image(s), or enter them in manually using the text field above. Loading multiple background images will create a slideshow effect. To clear, delete the image URLs from the text field and save your page.', '__x__'), 'id' => '_x_entry_bg_image_full', 'type' => 'uploader', 'std' => ''), array('name' => __('Background Image(s) Fade', '__x__'), 'desc' => __('Set a time in milliseconds for your image(s) to fade in. To disable this feature, set the value to "0."', '__x__'), 'id' => '_x_entry_bg_image_full_fade', 'type' => 'text', 'std' => '750'), array('name' => __('Background Images Duration', '__x__'), 'desc' => __('Only applicable if multiple images are selected, creating a background image slider. Set a time in milliseconds for your images to remain on screen.', '__x__'), 'id' => '_x_entry_bg_image_full_duration', 'type' => 'text', 'std' => '7500'))); x_add_meta_box($meta_box); // // Quote. // $meta_box = array('id' => 'x-meta-box-quote', 'title' => __('Quote Post Settings', '__x__'), 'description' => __('Input your quote.', '__x__'), 'page' => 'post', 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('The Quote', '__x__'), 'desc' => __('Input your quote.', '__x__'), 'id' => '_x_quote_quote', 'type' => 'textarea', 'std' => ''), array('name' => __('Citation', '__x__'), 'desc' => __('Specify who originally said the quote.', '__x__'), 'id' => '_x_quote_cite', 'type' => 'text', 'std' => ''))); x_add_meta_box($meta_box); // // Link. // $meta_box = array('id' => 'x-meta-box-link', 'title' => __('Link Post Settings', '__x__'), 'description' => __('Input your link.', '__x__'), 'page' => 'post', 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('The Link', '__x__'), 'desc' => __('Insert your link URL, e.g. http://www.themeforest.net.', '__x__'), 'id' => '_x_link_url', 'type' => 'text', 'std' => ''))); x_add_meta_box($meta_box); // // Video. // $meta_box = array('id' => 'x-meta-box-video', 'title' => __('Video Post Settings', '__x__'), 'description' => __('These settings enable you to embed videos into your posts.', '__x__'), 'page' => 'post', 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Aspect Ratio', '__x__'), 'desc' => __('Select the aspect ratio for your video.', '__x__'), 'id' => '_x_video_aspect_ratio', 'type' => 'select', 'std' => '', 'options' => array('16:9', '5:3', '5:4', '4:3', '3:2')), array('name' => __('M4V File URL', '__x__'), 'desc' => __('The URL to the .m4v video file.', '__x__'), 'id' => '_x_video_m4v', 'type' => 'text', 'std' => ''), array('name' => __('OGV File URL', '__x__'), 'desc' => __('The URL to the .ogv video file.', '__x__'), 'id' => '_x_video_ogv', 'type' => 'text', 'std' => ''), array('name' => __('Embedded Video Code', '__x__'), 'desc' => __('If you are using something other than self hosted video such as YouTube, Vimeo, or Wistia, paste the embed code here. This field will override the above.', '__x__'), 'id' => '_x_video_embed', 'type' => 'textarea', 'std' => ''))); x_add_meta_box($meta_box); // // Audio. // $meta_box = array('id' => 'x-meta-box-audio', 'title' => __('Audio Post Settings', '__x__'), 'description' => __('These settings enable you to embed audio into your posts.', '__x__'), 'page' => 'post', 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('MP3 File URL', '__x__'), 'desc' => __('The URL to the .mp3 audio file.', '__x__'), 'id' => '_x_audio_mp3', 'type' => 'text', 'std' => ''), array('name' => __('OGA File URL', '__x__'), 'desc' => __('The URL to the .oga or .ogg audio file.', '__x__'), 'id' => '_x_audio_ogg', 'type' => 'text', 'std' => ''), array('name' => __('Embedded Audio Code', '__x__'), 'desc' => __('If you are using something other than self hosted audio such as Soundcloud paste the embed code here. This field will override the above.', '__x__'), 'id' => '_x_audio_embed', 'type' => 'textarea', 'std' => ''))); x_add_meta_box($meta_box); // // Ethos. // if (x_get_stack() == 'ethos') { $meta_box = array('id' => 'x-meta-box-post-ethos', 'title' => __('Ethos Post Settings', '__x__'), 'description' => __('Here you will find some options specific to Ethos that you can use to create different post layouts.', '__x__'), 'page' => 'post', 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Index Featured Post Layout', '__x__'), 'desc' => __('Make the featured image of this post fullwidth on the blog index page.', '__x__'), 'id' => '_x_ethos_index_featured_post_layout', 'type' => 'checkbox', 'std' => ''), array('name' => __('Index Featured Post Size', '__x__'), 'desc' => __('If the "Index Featured Post Layout" option above is selected, select a size for the output.', '__x__'), 'id' => '_x_ethos_index_featured_post_size', 'type' => 'radio', 'std' => 'Skinny', 'options' => array('Big', 'Skinny')), array('name' => __('Post Carousel Display', '__x__'), 'desc' => __('Display this post in the Post Carousel if you have "Featured" selected in the Customizer.', '__x__'), 'id' => '_x_ethos_post_carousel_display', 'type' => 'checkbox', 'std' => ''), array('name' => __('Post Slider Display – Blog', '__x__'), 'desc' => __('Display this post in the Blog Post Slider if you have "Featured" selected in the Customizer.', '__x__'), 'id' => '_x_ethos_post_slider_blog_display', 'type' => 'checkbox', 'std' => ''), array('name' => __('Post Slider Display – Archives', '__x__'), 'desc' => __('Display this post in the Archives Post Slider if you have "Featured" selected in the Customizer.', '__x__'), 'id' => '_x_ethos_post_slider_archives_display', 'type' => 'checkbox', 'std' => ''))); x_add_meta_box($meta_box); } }
function x_entry_navigation() { $stack = x_get_stack(); if ($stack == 'ethos') { $left_icon = '<i class="x-icon-chevron-left" data-x-icon=""></i>'; $right_icon = '<i class="x-icon-chevron-right" data-x-icon=""></i>'; } else { $left_icon = '<i class="x-icon-arrow-left" data-x-icon=""></i>'; $right_icon = '<i class="x-icon-arrow-right" data-x-icon=""></i>'; } $is_ltr = !is_rtl(); $prev_post = get_adjacent_post(false, '', false); $next_post = get_adjacent_post(false, '', true); $prev_icon = $is_ltr ? $left_icon : $right_icon; $next_icon = $is_ltr ? $right_icon : $left_icon; ?> <div class="x-nav-articles"> <?php if ($prev_post) { ?> <a href="<?php echo get_permalink($prev_post); ?> " title="<?php __('Previous Post', '__x__'); ?> " class="prev"> <?php echo $prev_icon; ?> </a> <?php } ?> <?php if ($next_post) { ?> <a href="<?php echo get_permalink($next_post); ?> " title="<?php __('Next Post', '__x__'); ?> " class="next"> <?php echo $next_icon; ?> </a> <?php } ?> </div> <?php }
function x_enqueue_site_styles() { // // Stack data. // $stack = x_get_stack(); $design = x_get_option('x_integrity_design'); if ($stack == 'integrity' && $design == 'light') { $ext = '-light'; } elseif ($stack == 'integrity' && $design == 'dark') { $ext = '-dark'; } else { $ext = ''; } // // Register styles. // wp_register_style('x-stack', X_TEMPLATE_URL . '/framework/css/site/stacks/' . $stack . $ext . '.css', NULL, X_VERSION, 'all'); // // Enqueue styles. // if (is_child_theme()) { $dep = apply_filters('x_enqueue_parent_stylesheet', false) ? array('x-stack') : NULL; wp_enqueue_style('x-child', get_stylesheet_directory_uri() . '/style.css', $dep, X_VERSION, 'all'); } else { wp_enqueue_style('x-stack'); } if (is_rtl()) { wp_enqueue_style('x-rtl', X_TEMPLATE_URL . '/framework/css/site/rtl/' . $stack . '.css', NULL, X_VERSION, 'all'); } if (X_BBPRESS_IS_ACTIVE) { if (x_is_bbpress()) { wp_deregister_style('buttons'); } wp_deregister_style('bbp-default'); wp_enqueue_style('x-bbpress', X_TEMPLATE_URL . '/framework/css/site/bbpress/' . $stack . $ext . '.css', NULL, X_VERSION, 'all'); } if (X_BUDDYPRESS_IS_ACTIVE) { wp_deregister_style('bp-legacy-css'); wp_deregister_style('bp-admin-bar'); wp_enqueue_style('x-buddypress', X_TEMPLATE_URL . '/framework/css/site/buddypress/' . $stack . $ext . '.css', NULL, X_VERSION, 'all'); } if (X_WOOCOMMERCE_IS_ACTIVE) { wp_deregister_style('woocommerce-layout'); wp_deregister_style('woocommerce-general'); wp_deregister_style('woocommerce-smallscreen'); wp_enqueue_style('x-woocommerce', X_TEMPLATE_URL . '/framework/css/site/woocommerce/' . $stack . $ext . '.css', NULL, X_VERSION, 'all'); } if (X_GRAVITY_FORMS_IS_ACTIVE) { wp_enqueue_style('x-gravity-forms', X_TEMPLATE_URL . '/framework/css/site/gravity_forms/' . $stack . $ext . '.css', NULL, X_VERSION, 'all'); } if (X_CONTACT_FORM_7_IS_ACTIVE) { wp_deregister_style('contact-form-7'); } x_enqueue_google_fonts(); }
public function enqueue() { wp_enqueue_script('x_shortcodes_generator', X_SHORTCODES_URL . '/js/dist/admin/x-shortcodes-generator.min.js', array('backbone', 'underscore', 'jquery', 'jquery-ui-core', 'jquery-ui-accordion'), X_SHORTCODES_VERSION, true); $data = array('shortcodeCollectionUrl' => add_query_arg(array('action' => 'xsg_list_shortcodes'), admin_url('admin-ajax.php')), 'sectionNames' => $this->map->get_sections(), 'stackNames' => array('integrity' => __('Integrity', '__x__'), 'renew' => __('Renew', '__x__'), 'icon' => __('Icon', '__x__'), 'ethos' => __('Ethos', '__x__')), 'activeStack' => x_get_stack()); $strings = array(); wp_localize_script('x_shortcodes_generator', 'xsg', array('data' => $data, 'strings' => $strings)); wp_enqueue_style('xsg', X_SHORTCODES_URL . '/css/admin/shortcode-generator.css'); wp_enqueue_style('xsg-jquery-ui', X_SHORTCODES_URL . '/css/admin/jquery-ui.structure.min.css'); add_action('admin_footer', array($this, 'load_templates')); }
function x_get_content_layout() { $stack = x_get_stack(); $mod = get_theme_mod('x_' . $stack . '_layout_content'); $content_layout = $mod == '' ? 'content-sidebar' : $mod; if ($content_layout != 'full-width') { if (is_home()) { $mod = get_theme_mod('x_blog_layout'); $layout = $mod == 'sidebar' ? $content_layout : $mod; } elseif (is_singular('post')) { $meta = get_post_meta(get_the_ID(), '_x_post_layout', true); $layout = $meta == 'on' ? 'full-width' : $content_layout; } elseif (x_is_portfolio_item()) { $layout = 'full-width'; } elseif (x_is_product()) { $layout = 'full-width'; } elseif (x_is_portfolio()) { $meta = get_post_meta(get_the_ID(), '_x_portfolio_layout', true); $layout = $meta == 'sidebar' ? $content_layout : $meta; } elseif (is_page_template('template-layout-content-sidebar.php')) { $layout = 'content-sidebar'; } elseif (is_page_template('template-layout-sidebar-content.php')) { $layout = 'sidebar-content'; } elseif (is_page_template('template-layout-full-width.php')) { $layout = 'full-width'; } elseif (is_archive()) { if (x_is_shop()) { $mod = get_theme_mod('x_woocommerce_shop_layout_content'); $layout = $mod == 'sidebar' ? $content_layout : $mod; } else { $mod = get_theme_mod('x_archive_layout'); $layout = $mod == 'sidebar' ? $content_layout : $mod; } } elseif (x_is_product()) { $layout = 'full-width'; } elseif (is_404()) { $layout = 'full-width'; } else { $layout = $content_layout; } } else { $layout = $content_layout; } return $layout; }
function x_woocommerce_shop_thumbnail() { global $product; $stack = x_get_stack(); $stack_thumb = 'entry-full-' . $stack; $stack_shop_thumb = $stack_thumb; $id = get_the_ID(); $rating = $product->get_rating_html(); woocommerce_show_product_sale_flash(); echo '<div class="entry-featured">'; echo '<a href="' . get_the_permalink() . '">'; echo get_the_post_thumbnail($id, $stack_shop_thumb); if (!empty($rating)) { echo '<div class="star-rating-container aggregate">' . $rating . '</div>'; } echo '</a>'; echo "</div>"; }
function x_enqueue_site_scripts() { $get_template_directory_uri = get_template_directory_uri(); wp_register_script('x-site-head', $get_template_directory_uri . '/framework/js/dist/site/x-head.min.js', array('jquery'), NULL, false); wp_register_script('x-site-body', $get_template_directory_uri . '/framework/js/dist/site/x-body.min.js', array('jquery'), NULL, true); wp_register_script('x-site-icon', $get_template_directory_uri . '/framework/js/dist/site/x-icon.min.js', array('jquery'), NULL, true); wp_register_script('x-customizer-admin-js', $get_template_directory_uri . '/framework/js/dist/admin/x-customizer-admin.min.js', array('jquery'), NULL, true); wp_enqueue_script('x-site-head'); wp_enqueue_script('x-site-body'); if (x_get_stack() == 'icon') { wp_enqueue_script('x-site-icon'); } if (is_singular()) { wp_enqueue_script('comment-reply'); } if (is_admin_bar_showing()) { wp_enqueue_script('x-customizer-admin-js'); } }
function x_post_thumbnail_cropped_height_full() { $stack = x_get_stack(); switch ($stack) { case 'integrity': $output = round(x_post_thumbnail_width_full() * 0.558823529); break; case 'renew': $output = round(x_post_thumbnail_width_full() * 0.558823529); break; case 'icon': $output = round(x_post_thumbnail_width_full() * 0.558823529); break; case 'ethos': $output = round(x_post_thumbnail_width_full() * 0.558823529); break; } return intval($output); }
function x_enqueue_site_scripts() { wp_register_script('x-site-head', X_TEMPLATE_URL . '/framework/js/dist/site/x-head.min.js', array('jquery'), X_VERSION, false); wp_register_script('x-site-body', X_TEMPLATE_URL . '/framework/js/dist/site/x-body.min.js', array('jquery'), X_VERSION, true); wp_register_script('x-site-icon', X_TEMPLATE_URL . '/framework/js/dist/site/x-icon.min.js', array('jquery'), X_VERSION, true); wp_enqueue_script('x-site-head'); wp_enqueue_script('x-site-body'); if (x_get_stack() == 'icon') { wp_enqueue_script('x-site-icon'); } if (is_singular()) { wp_enqueue_script('comment-reply'); } if (X_BUDDYPRESS_IS_ACTIVE) { wp_dequeue_script('bp-legacy-js'); wp_dequeue_script('bp-parent-js'); wp_enqueue_script('x-site-buddypress', X_TEMPLATE_URL . '/framework/js/dist/site/x-buddypress.js', bp_core_get_js_dependencies(), X_VERSION, false); wp_localize_script('x-site-buddypress', 'BP_DTheme', x_buddypress_core_get_js_strings()); } }
<?php // ============================================================================= // VIEWS/GLOBAL/_PORTFOLIO.PHP // ----------------------------------------------------------------------------- // Includes the portfolio output. // ============================================================================= $stack = x_get_stack(); $entry_id = get_the_ID(); $paged = is_front_page() ? get_query_var('page') : (get_query_var('paged') ? get_query_var('paged') : 1); $cols = get_post_meta($entry_id, '_x_portfolio_columns', true); $count = get_post_meta($entry_id, '_x_portfolio_posts_per_page', true); $filters = get_post_meta($entry_id, '_x_portfolio_category_filters', true); switch ($cols) { case 'One': $cols = 1; break; case 'Two': $cols = 2; break; case 'Three': $cols = 3; break; case 'Four': $cols = 4; break; } ?> <?php x_get_view('global', '_script', 'isotope-portfolio');
<?php // ============================================================================= // TEMPLATE NAME: Layout - WOLFGANG // ----------------------------------------------------------------------------- // Handles output of fullwidth pages. // // Content is output based on which Stack has been selected in the Customizer. // To view and/or edit the markup of your Stack's index, first go to "views" // inside the "framework" subdirectory. Once inside, find your Stack's folder // and look for a file called "template-layout-full-width.php," where you'll be // able to find the appropriate output. // ============================================================================= ?> <?php x_get_view(x_get_stack(), 'template', 'layout-wolfgang');
function x_portfolio_item_tags() { $stack = x_get_stack(); $tag_title = x_get_option('x_portfolio_tag_title', __('Skills', '__x__')); if (has_term(NULL, 'portfolio-tag', NULL)) { echo '<h2 class="h-extra skills">' . $tag_title . '</h2>'; call_user_func('x_' . $stack . '_portfolio_tags'); } }
<?php // ============================================================================= // FOOTER.PHP // ----------------------------------------------------------------------------- // The site footer. Consists of the top footer area for widgets and the bottom // footer area for secondary information. Includes wp_footer() hook as well. // // Content is output based on which Stack has been selected in the Customizer. // To view and/or edit the markup of your Stack's index, first go to "views" // inside the "framework" subdirectory. Once inside, find your Stack's folder // and look for a file called "wp-footer.php," where you'll be able to find the // appropriate output. // ============================================================================= ?> <?php x_get_view(x_get_stack(), 'wp', 'footer');
<?php // ============================================================================= // SINGLE-X-PORTFOLIO.PHP // ----------------------------------------------------------------------------- // Handles output of individual portfolio posts. // // Content is output based on which Stack has been selected in the Customizer. // To view and/or edit the markup of your Stack's posts, first go to "views" // inside the "framework" subdirectory. Once inside, find your Stack's folder // and look for a file called "wp-single-x-portfolio.php," where you'll be able // to find the appropriate output. // ============================================================================= ?> <?php x_get_view(x_get_stack(), 'wp', 'single-x-portfolio');
<?php // ============================================================================= // TEMPLATE NAME: Layout - Sidebar Left, Content Right // ----------------------------------------------------------------------------- // Handles output of sidebar left, content right pages. // // Content is output based on which Stack has been selected in the Customizer. // To view and/or edit the markup of your Stack's index, first go to "views" // inside the "framework" subdirectory. Once inside, find your Stack's folder // and look for a file called "template-layout-sidebar-content.php," where // you'll be able to find the appropriate output. // ============================================================================= ?> <?php x_get_view(x_get_stack(), 'template', 'layout-sidebar-content');
<?php // ============================================================================= // SINGLE.PHP // ----------------------------------------------------------------------------- // Handles output of individual posts. // // Content is output based on which Stack has been selected in the Customizer. // To view and/or edit the markup of your Stack's posts, first go to "views" // inside the "framework" subdirectory. Once inside, find your Stack's folder // and look for a file called "wp-single.php," where you'll be able to find the // appropriate output. // ============================================================================= ?> <?php x_get_view(x_get_stack(), 'wp', 'single');
<?php // ============================================================================= // BBPRESS.PHP // ----------------------------------------------------------------------------- // Handles output of bbPress pages. // // Content is output based on which Stack has been selected in the Customizer. // To view and/or edit the markup of your Stack's pages, first go to "views" // inside the "framework" subdirectory. Once inside, find your Stack's folder // and look for a file called "wp-bbpress.php," where you'll be able to find // the appropriate output. // ============================================================================= ?> <?php x_get_view(x_get_stack(), 'wp', 'bbpress');
function x_customizer_custom_javascript_option_output() { $entry_id = get_the_ID(); $x_stack = x_get_stack(); $x_integrity_design = get_theme_mod('x_integrity_design'); $x_integrity_light_bg_image_full = get_theme_mod('x_integrity_light_bg_image_full'); $x_integrity_light_bg_image_full_fade = get_theme_mod('x_integrity_light_bg_image_full_fade'); $x_integrity_dark_bg_image_full = get_theme_mod('x_integrity_dark_bg_image_full'); $x_integrity_dark_bg_image_full_fade = get_theme_mod('x_integrity_dark_bg_image_full_fade'); $x_renew_bg_image_full = get_theme_mod('x_renew_bg_image_full'); $x_renew_bg_image_full_fade = get_theme_mod('x_renew_bg_image_full_fade'); $x_icon_bg_image_full = get_theme_mod('x_icon_bg_image_full'); $x_icon_bg_image_full_fade = get_theme_mod('x_icon_bg_image_full_fade'); $x_ethos_bg_image_full = get_theme_mod('x_ethos_bg_image_full'); $x_ethos_bg_image_full_fade = get_theme_mod('x_ethos_bg_image_full_fade'); $x_entry_bg_image_full = get_post_meta($entry_id, '_x_entry_bg_image_full', true); $x_entry_bg_image_full_fade = get_post_meta($entry_id, '_x_entry_bg_image_full_fade', true); $x_entry_bg_image_full_duration = get_post_meta($entry_id, '_x_entry_bg_image_full_duration', true); ?> <?php if (get_theme_mod('x_custom_scripts')) { ?> <script><?php echo get_theme_mod('x_custom_scripts'); ?> </script> <?php } ?> <?php if ($x_entry_bg_image_full) { ?> <?php $page_bg_images_output = ''; $page_bg_images = explode(',', $x_entry_bg_image_full); foreach ($page_bg_images as $page_bg_image) { $page_bg_images_output .= '"' . $page_bg_image . '", '; } $page_bg_images_output = trim($page_bg_images_output, ', '); ?> <script>jQuery.backstretch([<?php echo $page_bg_images_output; ?> ], {duration: <?php echo $x_entry_bg_image_full_duration; ?> , fade: <?php echo $x_entry_bg_image_full_fade; ?> });</script> <?php } else { ?> <?php if ($x_stack == 'integrity' && $x_integrity_design == 'light' && $x_integrity_light_bg_image_full) { ?> <script>jQuery.backstretch(['<?php echo x_make_protocol_relative($x_integrity_light_bg_image_full); ?> '], {fade: <?php echo $x_integrity_light_bg_image_full_fade; ?> });</script> <?php } elseif ($x_stack == 'integrity' && $x_integrity_design == 'dark' && $x_integrity_dark_bg_image_full) { ?> <script>jQuery.backstretch(['<?php echo x_make_protocol_relative($x_integrity_dark_bg_image_full); ?> '], {fade: <?php echo $x_integrity_dark_bg_image_full_fade; ?> });</script> <?php } elseif ($x_stack == 'renew' && $x_renew_bg_image_full) { ?> <script>jQuery.backstretch(['<?php echo x_make_protocol_relative($x_renew_bg_image_full); ?> '], {fade: <?php echo $x_renew_bg_image_full_fade; ?> });</script> <?php } elseif ($x_stack == 'icon' && $x_icon_bg_image_full) { ?> <script>jQuery.backstretch(['<?php echo x_make_protocol_relative($x_icon_bg_image_full); ?> '], {fade: <?php echo $x_icon_bg_image_full_fade; ?> });</script> <?php } elseif ($x_stack == 'ethos' && $x_ethos_bg_image_full) { ?> <script>jQuery.backstretch(['<?php echo x_make_protocol_relative($x_ethos_bg_image_full); ?> '], {fade: <?php echo $x_ethos_bg_image_full_fade; ?> });</script> <?php } ?> <?php } }
function x_portfolio_item_tags() { $stack = x_get_stack(); $tag_title = get_theme_mod('x_portfolio_tag_title'); if (has_term(NULL, 'portfolio-tag', NULL)) { echo '<h2 class="h-extra skills">' . $tag_title . '</h2>'; call_user_func('x_' . $stack . '_portfolio_tags'); } }
function x_featured_video($post_type = 'video') { $entry_id = get_the_ID(); $stack = x_get_stack(); $aspect_ratio = get_post_meta($entry_id, '_x_' . $post_type . '_aspect_ratio', true); $m4v = get_post_meta($entry_id, '_x_' . $post_type . '_m4v', true); $ogv = get_post_meta($entry_id, '_x_' . $post_type . '_ogv', true); $embed = get_post_meta($entry_id, '_x_' . $post_type . '_embed', true); $fullwidth = in_array('x-full-width-active', get_body_class()) ? true : false; if ($fullwidth) { $poster = wp_get_attachment_image_src(get_post_thumbnail_id($entry_id), 'entry-' . $stack . '-fullwidth', false); } else { $poster = wp_get_attachment_image_src(get_post_thumbnail_id($entry_id), 'entry-' . $stack, false); } switch ($aspect_ratio) { case '16:9': $aspect_ratio_class = ''; break; case '5:3': $aspect_ratio_class = 'five-by-three'; break; case '5:4': $aspect_ratio_class = 'five-by-four'; break; case '4:3': $aspect_ratio_class = 'four-by-three'; break; case '3:2': $aspect_ratio_class = 'three-by-two'; break; } if ($embed != '') { ?> <div class="x-responsive-video man"> <div class="x-responsive-video-inner <?php echo $aspect_ratio_class; ?> "> <?php echo stripslashes(htmlspecialchars_decode($embed)); ?> </div> </div> <?php } else { ?> <script> jQuery(document).ready(function($){ if($().jPlayer) { $('#x_jplayer_<?php echo $entry_id; ?> ').jPlayer({ ready: function () { $(this).jPlayer('setMedia', { <?php if ($m4v != '') { ?> m4v: '<?php echo $m4v; ?> ', <?php } ?> <?php if ($ogv != '') { ?> ogv: '<?php echo $ogv; ?> ', <?php } ?> <?php if ($poster != '') { ?> poster: '<?php echo $poster[0]; ?> ' <?php } ?> }); }, size: { width: '100%', height: '100%' }, swfPath: '<?php echo get_template_directory_uri(); ?> /framework/js/src/vendor/jplayer', cssSelectorAncestor: '#jp_interface_<?php echo $entry_id; ?> ', supplied: '<?php if ($m4v != "") { ?> m4v, <?php } if ($ogv != "") { ?> ogv<?php } ?> ' }); $('#x_jplayer_<?php echo $entry_id; ?> ').bind($.jPlayer.event.playing, function(event) { $(this).add('#jp_interface_<?php echo $entry_id; ?> ').hover( function() { $('#jp_interface_<?php echo $entry_id; ?> ').stop().animate({ opacity: 1 }, 400); }, function() { $('#jp_interface_<?php echo $entry_id; ?> ').stop().animate({ opacity: 0 }, 400); }); }); $('#x_jplayer_<?php echo $entry_id; ?> ').bind($.jPlayer.event.pause, function(event) { $('#x_jplayer_<?php echo $entry_id; ?> ').add('#jp_interface_<?php echo $entry_id; ?> ').unbind('hover'); $('#jp_interface_<?php echo $entry_id; ?> ').stop().animate({ opacity: 1 }, 400); }); } }); </script> <div class="x-responsive-video man"> <div class="x-responsive-video-inner <?php echo $aspect_ratio_class; ?> "> <div id="x_jplayer_<?php echo $entry_id; ?> " class="jp-jplayer jp-jplayer-video"></div> <div class="jp-controls-container jp-controls-container-video"> <div id="jp_interface_<?php echo $entry_id; ?> " class="jp-interface"> <ul class="jp-controls"> <li><a href="#" class="jp-play" tabindex="1"><span>Play</span></a></li> <li><a href="#" class="jp-pause" tabindex="1"><span>Pause</span></a></li> </ul> <div class="jp-progress-container"> <div class="jp-progress"> <div class="jp-seek-bar"> <div class="jp-play-bar"></div> </div> </div> </div> </div> </div> </div> </div> <?php } }
<?php // ============================================================================= // WOOCOMMERCE.PHP // ----------------------------------------------------------------------------- // Handles output of individual WooCommerce pages. // // Content is output based on which Stack has been selected in the Customizer. // To view and/or edit the markup of your Stack's pages, first go to "views" // inside the "framework" subdirectory. Once inside, find your Stack's folder // and look for a file called "woocommerce.php," where you'll be able to find // the appropriate output. // ============================================================================= ?> <?php x_get_view(x_get_stack(), 'woocommerce');
<?php // ============================================================================= // SIDEBAR.PHP // ----------------------------------------------------------------------------- // Handles sidebar output for posts and pages. // // Content is output based on which Stack has been selected in the Customizer. // To view and/or edit the markup of your Stack's pages, first go to "views" // inside the "framework" subdirectory. Once inside, find your Stack's folder // and look for a file called "wp-sidebar.php," where you'll be able to find // the appropriate output. // ============================================================================= ?> <?php x_get_view(x_get_stack(), 'wp', 'sidebar');
function x_featured_video($post_type = 'video') { $entry_id = get_the_ID(); $stack = x_get_stack(); $aspect_ratio = get_post_meta($entry_id, '_x_' . $post_type . '_aspect_ratio', true); $m4v = get_post_meta($entry_id, '_x_' . $post_type . '_m4v', true); $ogv = get_post_meta($entry_id, '_x_' . $post_type . '_ogv', true); $embed = get_post_meta($entry_id, '_x_' . $post_type . '_embed', true); $fullwidth = in_array('x-full-width-active', get_body_class()) ? true : false; if ($fullwidth) { $poster = wp_get_attachment_image_src(get_post_thumbnail_id($entry_id), 'entry-fullwidth', false); } else { $poster = wp_get_attachment_image_src(get_post_thumbnail_id($entry_id), 'entry', false); } if ($embed != '') { echo do_shortcode('[x_video_embed type="' . $aspect_ratio . '" no_container="true" class="mvn"]' . stripslashes(htmlspecialchars_decode($embed)) . '[/x_video_embed]'); } else { echo do_shortcode('[x_video_player m4v="' . $m4v . '" ogv="' . $ogv . '" poster="' . $poster[0] . '" type="' . $aspect_ratio . '" preload="metadata" hide_controls="false" autoplay="false" loop="false" muted="false" no_container="true" class="mvn"]'); } }
public function shortcodeGeneratorDemoURL($attributes) { if (isset($attributes['demo'])) { $attributes['demo'] = str_replace('integrity', x_get_stack(), $attributes['demo']); } return $attributes; }
<?php // ============================================================================= // VIEWS/GLOBAL/_CONTENT.PHP // ----------------------------------------------------------------------------- // Display of the_excerpt() or the_content() for various entries. // ============================================================================= $is_full_post_content_blog = is_home() && get_theme_mod('x_blog_enable_full_post_content') == 1; ?> <?php if (is_singular() || $is_full_post_content_blog) { x_get_view('global', '_content', 'the-content'); if (x_get_stack() == 'renew') { x_get_view('renew', '_content', 'post-footer'); } } else { x_get_view('global', '_content', 'the-excerpt'); }
function x_enqueue_site_styles() { // // Stack data. // $stack = x_get_stack(); $design = x_get_option('x_integrity_design', 'light'); if ($stack == 'integrity' && $design == 'light') { $ext = '-light'; } elseif ($stack == 'integrity' && $design == 'dark') { $ext = '-dark'; } else { $ext = ''; } // // Font data. // $body_font_family_query = x_get_font_family_query(x_get_option('x_body_font_family', 'Lato')); $body_font_weight_and_style = x_get_option('x_body_font_weight', '400'); $body_font_weight = x_get_font_weight($body_font_weight_and_style); $headings_font_family_query = x_get_font_family_query(x_get_option('x_headings_font_family', 'Lato')); $headings_font_weight_and_style = x_get_option('x_headings_font_weight', '400'); $headings_font_weight = x_get_font_weight($headings_font_weight_and_style); $logo_font_family_query = x_get_font_family_query(x_get_option('x_logo_font_family', 'Lato')); $logo_font_weight_and_style = x_get_option('x_logo_font_weight', '400'); $logo_font_weight = x_get_font_weight($logo_font_weight_and_style); $navbar_font_family_query = x_get_font_family_query(x_get_option('x_navbar_font_family', 'Lato')); $navbar_font_weight_and_style = x_get_option('x_navbar_font_weight', '400'); $navbar_font_weight = x_get_font_weight($navbar_font_weight_and_style); $subsets = 'latin,latin-ext'; if (x_get_option('x_custom_font_subsets', '') == '1') { if (x_get_option('x_custom_font_subset_cyrillic', '') == '1') { $subsets .= ',cyrillic,cyrillic-ext'; } if (x_get_option('x_custom_font_subset_greek', '') == '1') { $subsets .= ',greek,greek-ext'; } if (x_get_option('x_custom_font_subset_vietnamese', '') == '1') { $subsets .= ',vietnamese'; } } $custom_font_args = array('family' => $body_font_family_query . ':' . $body_font_weight . ',' . $body_font_weight . 'italic,700,700italic|' . $navbar_font_family_query . ':' . $navbar_font_weight_and_style . '|' . $headings_font_family_query . ':' . $headings_font_weight_and_style . '|' . $logo_font_family_query . ':' . $logo_font_weight_and_style, 'subset' => $subsets); $standard_font_args = array('family' => 'Lato:' . $body_font_weight . ',' . $body_font_weight . 'italic,' . $navbar_font_weight_and_style . ',' . $headings_font_weight_and_style . ',' . $logo_font_weight_and_style . ',700,700italic', 'subset' => $subsets); $get_custom_font_family = add_query_arg($custom_font_args, '//fonts.googleapis.com/css'); $get_standard_font_family = add_query_arg($standard_font_args, '//fonts.googleapis.com/css'); // // Register styles. // wp_register_style('x-stack', X_TEMPLATE_URL . '/framework/css/site/stacks/' . $stack . $ext . '.css', NULL, X_VERSION, 'all'); // // Enqueue styles. // if (is_child_theme()) { $dep = apply_filters('x_enqueue_parent_stylesheet', false) ? array('x-stack') : NULL; wp_enqueue_style('x-child', get_stylesheet_directory_uri() . '/style.css', $dep, X_VERSION, 'all'); } else { wp_enqueue_style('x-stack'); } if (is_rtl()) { wp_enqueue_style('x-rtl', X_TEMPLATE_URL . '/framework/css/site/rtl/' . $stack . '.css', NULL, X_VERSION, 'all'); } if (X_BBPRESS_IS_ACTIVE) { if (x_is_bbpress()) { wp_deregister_style('buttons'); } wp_deregister_style('bbp-default'); wp_enqueue_style('x-bbpress', X_TEMPLATE_URL . '/framework/css/site/bbpress/' . $stack . $ext . '.css', NULL, X_VERSION, 'all'); } if (X_BUDDYPRESS_IS_ACTIVE) { wp_deregister_style('bp-legacy-css'); wp_deregister_style('bp-admin-bar'); wp_enqueue_style('x-buddypress', X_TEMPLATE_URL . '/framework/css/site/buddypress/' . $stack . $ext . '.css', NULL, X_VERSION, 'all'); } if (X_WOOCOMMERCE_IS_ACTIVE) { wp_deregister_style('woocommerce-layout'); wp_deregister_style('woocommerce-general'); wp_deregister_style('woocommerce-smallscreen'); wp_enqueue_style('x-woocommerce', X_TEMPLATE_URL . '/framework/css/site/woocommerce/' . $stack . $ext . '.css', NULL, X_VERSION, 'all'); } if (X_GRAVITY_FORMS_IS_ACTIVE) { wp_enqueue_style('x-gravity-forms', X_TEMPLATE_URL . '/framework/css/site/gravity_forms/' . $stack . $ext . '.css', NULL, X_VERSION, 'all'); } if (X_CONTACT_FORM_7_IS_ACTIVE) { wp_deregister_style('contact-form-7'); } if (x_get_option('x_custom_fonts', '') == '1') { wp_enqueue_style('x-font-custom', $get_custom_font_family, NULL, X_VERSION, 'all'); } else { wp_enqueue_style('x-font-standard', $get_standard_font_family, NULL, X_VERSION, 'all'); } }
public function x_get_stack() { // Some plugins abort the theme loading process in certain contexts. // This provide a safe fallback for x_get_stack calls if (function_exists('x_get_stack')) { return x_get_stack(); } return apply_filters('x_option_x_stack', get_option('x_stack', 'integrity')); }
<?php // ============================================================================= // 404.PHP // ----------------------------------------------------------------------------- // Handles errors when pages do not exist. // // Content is output based on which Stack has been selected in the Customizer. // To view and/or edit the markup of your Stack's index, first go to "views" // inside the "framework" subdirectory. Once inside, find your Stack's folder // and look for a file called "wp-404.php," where you'll be able to find the // appropriate output. // ============================================================================= ?> <?php x_get_view(x_get_stack(), 'wp', '404');
<?php // ============================================================================= // TEMPLATE NAME: Blank - Container | Header, No Footer // ----------------------------------------------------------------------------- // A blank page for creating unique layouts. // // Content is output based on which Stack has been selected in the Customizer. // To view and/or edit the markup of your Stack's index, first go to "views" // inside the "framework" subdirectory. Once inside, find your Stack's folder // and look for a file called "template-blank-2.php," where you'll be able to // find the appropriate output. // ============================================================================= ?> <?php x_get_view(x_get_stack(), 'template', 'blank-2');