function __construct() { self::$instance = $this; add_action('customize_register', array($this, 'register_settings')); add_action('customize_preview_init', array($this, 'live_preview')); add_filter('post_class', array($this, 'blocks_classes'), 10, 3); add_action('admin_init', array($this, 'editor_style')); }
<?php global $multipage; if (!function_exists('skrollr_blockgal_get_instance')) { function skrollr_blockgal_get_instance() { static $instance = 0; $instance++; return $instance; } } // get the custom layout $class = Skrollr_Customize_Layout::get_instance()->get_layout_classes(); // split down the content into shortcode / content / shortcode parts $content = get_the_content(); $pattern = get_shortcode_regex(); $content_parts = preg_split("/{$pattern}/s", $content, -1, PREG_SPLIT_OFFSET_CAPTURE); // show the title only if there is content (appart from the gallery) $show_title = trim(strip_shortcodes($content)) != '' || $multipage; ?> <div <?php post_class(); ?> id="<?php echo esc_attr($post->post_name); ?> "> <?php // display the content without gallery foreach ($content_parts as $i => $part) { if ($show_title) {