Ejemplo n.º 1
0
/**
 * $content_width global variable adjustment as per layout option.
 */
function spacious_content_width()
{
    global $post;
    global $content_width;
    if ($post) {
        $layout_meta = get_post_meta($post->ID, 'spacious_page_layout', true);
    }
    if (empty($layout_meta) || is_archive() || is_search()) {
        $layout_meta = 'default_layout';
    }
    $spacious_default_layout = spacious_options('default_layout', 'right_sidebar');
    if ($layout_meta == 'default_layout') {
        if (spacious_options('spacious_site_layout', 'box_1218px') == 'box_978px' || spacious_options('spacious_site_layout', 'box_1218px') == 'wide_978px') {
            if ($spacious_default_layout == 'no_sidebar_full_width') {
                $content_width = 978;
                /* pixels */
            } else {
                $content_width = 642;
                /* pixels */
            }
        } elseif ($spacious_default_layout == 'no_sidebar_full_width') {
            $content_width = 1218;
            /* pixels */
        } else {
            $content_width = 750;
            /* pixels */
        }
    } elseif (spacious_options('spacious_site_layout', 'box_1218px') == 'box_978px' || spacious_options('spacious_site_layout', 'box_1218px') == 'wide_978px') {
        if ($layout_meta == 'no_sidebar_full_width') {
            $content_width = 978;
            /* pixels */
        } else {
            $content_width = 642;
            /* pixels */
        }
    } elseif ($layout_meta == 'no_sidebar_full_width') {
        $content_width = 1218;
        /* pixels */
    } else {
        $content_width = 750;
        /* pixels */
    }
}
" title="<?php 
the_title_attribute();
?>
"><?php 
the_title();
?>
</a>
		</h1><!-- .entry-title -->
	</header>

	<div class="post-image-content-wrap clearfix">
		<?php 
if (has_post_thumbnail()) {
    if (spacious_options('spacious_site_layout', 'box_1218px') == 'box_1218px' || spacious_options('spacious_site_layout', 'box_1218px') == 'wide_1218px') {
        $featured = 'featured-blog-medium';
    } elseif (spacious_options('spacious_site_layout', 'box_1218px') == 'box_978px' || spacious_options('spacious_site_layout', 'box_1218px') == 'wide_978px') {
        $featured = 'featured-blog-medium-small';
    }
    $image = '';
    $title_attribute = get_the_title($post->ID);
    $image .= '<figure class="post-featured-image">';
    $image .= '<a href="' . get_permalink() . '" title="' . the_title('', '', false) . '">';
    $image .= get_the_post_thumbnail($post->ID, $featured, array('title' => esc_attr($title_attribute), 'alt' => esc_attr($title_attribute))) . '</a>';
    $image .= '</figure>';
    echo $image;
}
?>

		<div class="entry-content clearfix">
			<?php 
the_excerpt();
Ejemplo n.º 3
0
?>

		<?php 
if (spacious_options('spacious_activate_slider', '0') == '1') {
    if (spacious_options('spacious_blog_slider', '0') != '1') {
        if (is_home() || is_front_page()) {
            spacious_featured_image_slider();
        }
    } else {
        if (is_front_page()) {
            spacious_featured_image_slider();
        }
    }
}
if ('' != spacious_header_title() && !is_front_page()) {
    if (!(spacious_options('spacious_blog_slider', '0') != '1' && is_home())) {
        ?>
				<div class="header-post-title-container clearfix">
					<div class="inner-wrap">
						<div class="post-title-wrapper">
							<?php 
        if ('' != spacious_header_title()) {
            ?>
                        <?php 
            if (is_home()) {
                ?>
   						   	<h2 class="header-post-title-class"><?php 
                echo spacious_header_title();
                ?>
</h2>
                        <?php 
Ejemplo n.º 4
0
    /**
     * Shows meta information of post.
     */
    function spacious_entry_meta()
    {
        if ('post' == get_post_type()) {
            echo '<footer class="entry-meta-bar clearfix">';
            echo '<div class="entry-meta clearfix">';
            ?>

      <span class="by-author author vcard"><a class="url fn n" href="<?php 
            echo get_author_posts_url(get_the_author_meta('ID'));
            ?>
"><?php 
            the_author();
            ?>
</a></span>

      <?php 
            $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>';
            if (get_the_time('U') !== get_the_modified_time('U')) {
                $time_string .= '<time class="updated" datetime="%3$s">%4$s</time>';
            }
            $time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
            printf(__('<span class="date"><a href="%1$s" title="%2$s" rel="bookmark">%3$s</a></span>', 'spacious'), esc_url(get_permalink()), esc_attr(get_the_time()), $time_string);
            ?>

      <?php 
            if (has_category()) {
                ?>
         <span class="category"><?php 
                the_category(', ');
                ?>
</span>
      <?php 
            }
            ?>

      <?php 
            if (comments_open()) {
                ?>
         <span class="comments"><?php 
                comments_popup_link(__('No Comments', 'spacious'), __('1 Comment', 'spacious'), __('% Comments', 'spacious'), '', __('Comments Off', 'spacious'));
                ?>
</span>
      <?php 
            }
            ?>

      <?php 
            edit_post_link(__('Edit', 'spacious'), '<span class="edit-link">', '</span>');
            ?>

      <?php 
            if (spacious_options('spacious_archive_display_type', 'blog_large') != 'blog_full_content' && !is_single()) {
                ?>
         <span class="read-more-link"><a class="read-more" href="<?php 
                the_permalink();
                ?>
"><?php 
                _e('Read more', 'spacious');
                ?>
</a></span>
      <?php 
            }
            ?>

      <?php 
            echo '</div>';
            echo '</footer>';
        }
    }
Ejemplo n.º 5
0
    /**
     * display featured post slider
     */
    function spacious_featured_image_slider()
    {
        global $post;
        ?>
		<section id="featured-slider">
			<div class="slider-cycle">
				<?php 
        for ($i = 1; $i <= 5; $i++) {
            $spacious_slider_title = spacious_options('spacious_slider_title' . $i, '');
            $spacious_slider_text = spacious_options('spacious_slider_text' . $i, '');
            $spacious_slider_image = spacious_options('spacious_slider_image' . $i, '');
            $spacious_slider_button_text = spacious_options('spacious_slider_button_text' . $i, __('Read more', 'spacious'));
            $spacious_slider_link = spacious_options('spacious_slider_link' . $i, '#');
            if (!empty($spacious_header_title) || !empty($spacious_slider_text) || !empty($spacious_slider_image)) {
                if ($i == 1) {
                    $classes = "slides displayblock";
                } else {
                    $classes = "slides displaynone";
                }
                ?>
						<div class="<?php 
                echo $classes;
                ?>
">
							<figure>
								<img alt="<?php 
                echo esc_attr($spacious_slider_title);
                ?>
" src="<?php 
                echo esc_url($spacious_slider_image);
                ?>
">
							</figure>
							<div class="entry-container">
								<?php 
                if (!empty($spacious_slider_title) || !empty($spacious_slider_text)) {
                    ?>
								<div class="entry-description-container">
									<?php 
                    if (!empty($spacious_slider_title)) {
                        ?>
									<div class="slider-title-head"><h3 class="entry-title"><a href="<?php 
                        echo esc_url($spacious_slider_link);
                        ?>
" title="<?php 
                        echo esc_attr($spacious_slider_title);
                        ?>
"><span><?php 
                        echo esc_html($spacious_slider_title);
                        ?>
</span></a></h3></div>
									<?php 
                    }
                    if (!empty($spacious_slider_text)) {
                        ?>
									<div class="entry-content"><p><?php 
                        echo esc_textarea($spacious_slider_text);
                        ?>
</p></div>
									<?php 
                    }
                    ?>
								</div>
								<?php 
                }
                ?>
								<div class="clearfix"></div>
								<?php 
                if (!empty($spacious_slider_button_text)) {
                    ?>
								<a class="slider-read-more-button" href="<?php 
                    echo esc_url($spacious_slider_link);
                    ?>
" title="<?php 
                    echo esc_attr($spacious_slider_title);
                    ?>
"><?php 
                    echo esc_html($spacious_slider_button_text);
                    ?>
</a>
								<?php 
                }
                ?>
							</div>
						</div>
						<?php 
            }
        }
        ?>
 <nav id="controllers" class="clearfix"></nav>
			</div>
		</section>

		<?php 
    }