private function setAlignment($align) { if ($this->have_option) { $align_class = get_the_aligment($align); $this->align = $align_class; } else { $this->align = ''; } }
public static function display_showcase($args, $return = false) { $display = ""; if (!empty($args)) { $display .= "<section id=\"" . $args['category'] . "\" class=\"ui basic " . get_the_color($args['color'], $args['inverted']) . " vertical segment center aligned\">"; $display .= "<br><br>"; $display .= "<div class=\"ui container\">"; $display .= "<h1 class=\"ui " . get_the_aligment($args['title_alignment']) . " huge header\">"; $display .= "<div class='content'>"; $display .= !$args['title'] ? __(ucfirst($args['category']), 'sage') : $args['title']; $display .= "<div class='sub header'>" . $args['subtitle'] . "</div>"; $display .= "</div>"; $display .= "</h1>"; $query = self::showcase_query($args['posttype'], $args['category']); if ($query && $query->have_posts()) { $display .= "<div id='landing-showcase' class='landing-showcase'>"; while ($query->have_posts()) { $query->the_post(); $id = $query->post->ID; $info = self::get_post_data($args['posttype'], $args['category'], $id); if (!empty($info)) { $data[] = $info; } else { $data = array(); } } if (!empty($data)) { $display .= self::get_component($args['component'], $data); } else { $display .= "<h3>" . 'Sorry! Currently there are no ' . __(ucfirst($args['category']), 'sage') . "</h3>"; } $display .= "</div>"; } else { $display .= "<h3>" . 'Sorry! Currently there are no ' . __(ucfirst($args['category']), 'sage') . "</h3>"; } $display .= "</div>"; $display .= "<br><br><br>"; $display .= "</section>"; } if (!$return) { echo $display; } else { return $display; } }
if (!empty($args)) { $textimage_option = $args['textimage_options']; ?> <!-- Showcase Section --> <section id="<?php echo $args['category']; ?> " class="ui basic <?php echo get_the_color($args['color'], $args['inverted']); ?> vertical segment center aligned"> <br><br> <div class="ui container"> <h1 class="ui <?php echo get_the_aligment($args['title_alignment']); ?> huge header"> <div class="content"> <?php if (!$args['title']) { ?> <?php echo __(ucfirst($args['category']), 'sage'); ?> <?php } else { ?> <?php echo $args['title']; ?>
private function setSectionLayout() { $layout['container_class'] = ''; $layout['container_style'] = 'padding: 0px 15px 0 15px;'; if ($this->background['type'] == 'color' || $this->background['type'] == 'none') { $layout['content_color'] = 'color:#000000;'; $layout['title_color'] = 'color:#000000;'; } else { $layout['content_color'] = 'color:#FFFFFF;'; $layout['title_color'] = 'color:#FFFFFF;'; } $layout['title_alignment'] = 'center aligned'; $layout['title'] = ucwords(str_replace('_', ' ', $this->content_settings['category'])); $layout['subtitle'] = ''; if ($this->source == 'showcase' && $this->content_settings['show_layout'] == 'TRUE') { if ($this->content_settings['container'] == 'container') { $layout['container_class'] = 'container'; $layout['container_style'] = ''; } if (!empty($this->content_settings['content_color'])) { $layout['content_color'] = 'color:' . $this->content_settings['content_color'] . ';'; } if (!empty($this->content_settings['title_color'])) { $layout['title_color'] = 'color:' . $this->content_settings['title_color'] . ';'; } if (!empty($this->content_settings['title_alignment'])) { $layout['title_alignment'] = get_the_aligment($this->content_settings['title_alignment']); } if (!empty($this->content_settings['segment_title'])) { $layout['title'] = $this->content_settings['segment_title']; } if (!empty($this->content_settings['segment_subtitle'])) { $layout['subtitle'] = $this->content_settings['segment_subtitle']; } } $this->layout = $layout; }