/** * Output css for all Stacks inside widgets in the footer. We use the global variable $mp_stacks_widget_stacks to know which ones have been displayed. * Parameter: none */ function mp_stacks_widgets_css() { global $mp_stacks_widget_stacks; //Loop through each stack in each widget (this array is created in the widget class) if (is_array($mp_stacks_widget_stacks)) { foreach ($mp_stacks_widget_stacks as $widget_stack) { //Output CSS for this stack mp_stack_css($widget_stack, true); } } }
/** * Output JUST the css for a stack * * @since 1.0.0 * @link http://bullmandesign.com/quick-tips/too-much-of-a-good-thing * @param array $rules * @return array $rules */ function mp_stacks_css_page() { if (!isset($_GET['mp_stacks_css_page'])) { return false; } header('Content-Type: text/css'); //Output CSS for this stack echo mp_stack_css($_GET['mp_stacks_css_page'], false, false); die; }
/** * Function which return a template array for a stack * Parameter: Stack ID * Parameter: $args */ function mp_stack_only_page() { global $wp_query; if (isset($wp_query->query_vars['mp_stack_only_page'])) { $stack = get_term_by('slug', $wp_query->query_vars['mp_stack_only_page'], 'mp_stacks'); ?> <!DOCTYPE html> <html <?php language_attributes(); ?> > <head> <meta charset="<?php bloginfo('charset'); ?> " /> <title><?php wp_title('|', true, 'right'); ?> </title> <link rel="profile" href="//gmpg.org/xfn/11" /> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?> " /> <!--[if lt IE 9]> <script src="<?php echo get_template_directory_uri(); ?> /js/html5.js" type="text/javascript"></script> <![endif]--> <?php mp_stack_css($stack->term_id, true); ?> <?php wp_head(); ?> </head> <body class="body-mp-stack-only-<?php echo $stack->term_id; ?> "> <?php echo mp_stack($stack->term_id); ?> <div style="display:none;"> <?php wp_footer(); ?> </div> </body> </html> <?php die; } }