本文整理汇总了PHP中x_get_stack函数的典型用法代码示例。如果您正苦于以下问题:PHP x_get_stack函数的具体用法?PHP x_get_stack怎么用?PHP x_get_stack使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了x_get_stack函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: x_customizer_generated_css_output
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;
}
示例2: x_add_post_meta_boxes
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);
}
}
示例3: x_entry_navigation
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
}
示例4: x_enqueue_site_styles
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();
}
示例5: enqueue
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'));
}
示例6: x_get_content_layout
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;
}
示例7: x_woocommerce_shop_thumbnail
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>";
}
示例8: x_enqueue_site_scripts
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');
}
}
示例9: x_post_thumbnail_cropped_height_full
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);
}
示例10: x_enqueue_site_scripts
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());
}
}
示例11: x_get_stack
<?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');
示例12: x_get_view
<?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');
示例13: x_portfolio_item_tags
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');
}
}
示例14: x_get_view
<?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');
示例15: x_get_view
<?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');