?> Page For Posts: <?php echo get_option('page_for_posts') . "\n"; ?> <?php if (!headway_get('exclude-counts')) { ?> Amount of Posts: ~<?php echo $post_count->publish . "\n"; ?> Amount of Pages: ~<?php echo $page_count->publish . "\n"; ?> Amount of Blocks: ~<?php echo count(HeadwayBlocksData::get_all_blocks()) . "\n"; ?> <?php } ?> Responsive Grid: <?php echo HeadwayResponsiveGrid::is_enabled() ? 'Enabled' . "\n" : 'Disabled' . "\n"; ?> Caching Allowed: <?php echo HeadwayCompiler::can_cache() ? 'Yes' . "\n" : 'No' . "\n"; ?> Caching Enabled: <?php echo HeadwayCompiler::caching_enabled() ? 'Yes' . "\n" : 'No' . "\n"; ?>
static function block_heights() { if (!($blocks = HeadwayBlocksData::get_all_blocks())) { return false; } $return = ''; //Retrieve the blocks so we can check if the block type is fixed or fluid height $block_types = HeadwayBlocks::get_block_types(); foreach ($blocks as $block) { $selector = '#block-' . $block['id']; /* If the block is mirrored then change the selector */ if ($mirrored_block_id = HeadwayBlocksData::is_block_mirrored($block, true)) { $selector = '#block-' . $mirrored_block_id . '.block-original-' . $block['id']; } //If it's a fluid block (which blocks ARE by default), then we need to use min-height. Otherwise, if it's fixed, we use height. if (headway_get('fixed-height', headway_get($block['type'], $block_types), false) !== true) { $return .= $selector . ' { min-height: ' . $block['dimensions']['height'] . 'px; }'; } else { $return .= $selector . ' { height: ' . $block['dimensions']['height'] . 'px; }'; } } return $return; }
public static function register_block_element_instances() { if ((headway_get('layout-in-use') || headway_post('layout')) && !headway_get('compiler-cache')) { $layout_id = headway_get('layout-in-use') ? headway_get('layout-in-use') : headway_post('layout'); $register_block_mirrors = true; if (!($blocks = HeadwayBlocksData::get_blocks_by_layout($layout_id))) { return false; } } else { $register_block_mirrors = false; if (!($blocks = HeadwayBlocksData::get_all_blocks())) { return false; } } foreach ($blocks as $block) { /* Do not register instance for block that's in a mirrored wrapper */ if (HeadwayWrappers::get_wrapper_mirror(HeadwayWrappers::get_wrapper(headway_get('wrapper', $block)))) { continue; } /* If it's a mirrored block then we'll register it as long as $register_block_mirrors is true */ if ($block_mirror = HeadwayBlocksData::is_block_mirrored($block)) { if (!$register_block_mirrors) { continue; } $block = $block_mirror; } $default_name = self::block_type_nice($block['type']) . ' #' . $block['id']; $name = headway_get('alias', $block['settings'], $default_name); HeadwayElementAPI::register_element_instance(array('group' => 'blocks', 'element' => 'block-' . $block['type'], 'id' => $block['type'] . '-block-' . $block['id'], 'name' => $name, 'selector' => '#block-' . $block['id'], 'layout' => $block['layout'])); /* Register sub elements */ $block_element = HeadwayElementAPI::get_element('block-' . $block['type']); foreach (headway_get('children', $block_element, array()) as $block_element_sub_element) { /* Make sure that the element supports instances */ if (!headway_get('supports-instances', $block_element_sub_element)) { continue; } /* Register instance */ $instance_selector = str_replace('.block-type-' . $block['type'], '#block-' . $block['id'], $block_element_sub_element['selector']); HeadwayElementAPI::register_element_instance(array('group' => 'blocks', 'grandparent' => 'block-' . $block['type'], 'element' => $block_element_sub_element['id'], 'id' => $block_element_sub_element['id'] . '-block-' . $block['id'], 'name' => $name . ' - ' . $block_element_sub_element['name'], 'selector' => $instance_selector, 'layout' => $block['layout'])); /* Register instance states as instances */ if (!empty($block_element_sub_element['states']) && is_array($block_element_sub_element['states'])) { foreach ($block_element_sub_element['states'] as $instance_state_id => $instance_state_info) { HeadwayElementAPI::register_element_instance(array('group' => 'blocks', 'grandparent' => 'block-' . $block['type'], 'element' => $block_element_sub_element['id'], 'id' => $block_element_sub_element['id'] . '-block-' . $block['id'] . '-state-' . $instance_state_id, 'name' => $name . ' - ' . $block_element_sub_element['name'] . ' (State: ' . $instance_state_info['name'] . ')', 'selector' => str_replace('.block-type-' . $block['type'], '#block-' . $block['id'], $instance_state_info['selector']), 'layout' => $block['layout'], 'state-of' => $block_element_sub_element['id'] . '-block-' . $block['id'], 'state-name' => $instance_state_info['name'])); } } } /* /foreach */ } }