Example #1
0
        function get_content_part()
        {
            global $post;
            ?>
			<div id="primary" class="content-area">
				<div id="content" class="site-content" role="main">	
			<?php 
            /* Start the Loop */
            $page_on_front = get_option('page_on_front');
            $page_for_posts = get_option('page_for_posts');
            if (is_page() && !empty($page_on_front) && !empty($page_for_posts) && $page_on_front == $page_for_posts) {
                echo '<div class="alert alert-danger"><strong>' . __("Front page displays Error.", 'fruitful') . '</strong> ' . __('Select different pages!', 'fruitful') . '</div>';
            } else {
                if (!is_archive() && !is_search() && !is_404()) {
                    if (is_home()) {
                        if (have_posts()) {
                            /* The loop */
                            while (have_posts()) {
                                the_post();
                                do_action('before_post_content_loop');
                                get_template_part('content', get_post_format());
                                do_action('after_post_content_loop');
                            }
                            fruitful_content_nav('nav-below');
                        } else {
                            get_template_part('no-results', 'index');
                        }
                    } else {
                        if (have_posts()) {
                            while (have_posts()) {
                                the_post();
                                if (is_page() && !is_front_page() && !is_home()) {
                                    get_template_part('content', 'page');
                                    if (fruitful_state_page_comment()) {
                                        comments_template('', true);
                                    }
                                } else {
                                    if (is_single()) {
                                        get_template_part('content', get_post_format());
                                        fruitful_content_nav('nav-below');
                                        if (fruitful_state_post_comment()) {
                                            if (comments_open() || '0' != get_comments_number()) {
                                                comments_template();
                                            }
                                        }
                                    } else {
                                        if (is_front_page()) {
                                            get_template_part('content', 'page');
                                        }
                                    }
                                }
                            }
                        }
                    }
                } else {
                    ?>
							<section id="primary" class="content-area">
								<div id="content" class="site-content" role="main">

								<?php 
                    if (have_posts()) {
                        ?>
										<header class="page-header">
											<h1 class="page-title">
												<?php 
                        if (is_archive()) {
                            if (is_category()) {
                                printf(__('Category Archives: %s', 'fruitful'), '<span>' . single_cat_title('', false) . '</span>');
                            } elseif (is_tag()) {
                                printf(__('Tag Archives: %s', 'fruitful'), '<span>' . single_tag_title('', false) . '</span>');
                            } elseif (is_author()) {
                                the_post();
                                printf(__('Author Archives: %s', 'fruitful'), '<span class="vcard"><a class="url fn n" href="' . get_author_posts_url(get_the_author_meta("ID")) . '" title="' . esc_attr(get_the_author()) . '" rel="me">' . get_the_author() . '</a></span>');
                                rewind_posts();
                            } elseif (is_day()) {
                                printf(__('Daily Archives: %s', 'fruitful'), '<span>' . get_the_date() . '</span>');
                            } elseif (is_month()) {
                                printf(__('Monthly Archives: %s', 'fruitful'), '<span>' . get_the_date('F Y') . '</span>');
                            } elseif (is_year()) {
                                printf(__('Yearly Archives: %s', 'fruitful'), '<span>' . get_the_date('Y') . '</span>');
                            } else {
                                _e('Archives', 'fruitful');
                            }
                        }
                        if (is_search()) {
                            printf(__('Search Results for: %s', 'fruitful'), '<span>' . get_search_query() . '</span>');
                        }
                        ?>
											</h1>
											<?php 
                        if (is_category()) {
                            $category_description = category_description();
                            if (!empty($category_description)) {
                                echo apply_filters('category_archive_meta', '<div class="taxonomy-description">' . $category_description . '</div>');
                            }
                        } elseif (is_tag()) {
                            $tag_description = tag_description();
                            if (!empty($tag_description)) {
                                echo apply_filters('tag_archive_meta', '<div class="taxonomy-description">' . $tag_description . '</div>');
                            }
                        }
                        ?>
										</header><!-- .page-header -->

										<?php 
                        /* Start the Loop */
                        while (have_posts()) {
                            the_post();
                            do_action('before_post_content_loop');
                            get_template_part('content', get_post_format());
                            do_action('after_post_content_loop');
                        }
                        fruitful_content_nav('nav-below');
                    } else {
                        if (is_404()) {
                            get_template_part('content', '404');
                        } else {
                            get_template_part('no-results', 'archive');
                        }
                    }
                    ?>

								</div><!-- #content .site-content -->
							</section><!-- #primary .content-area -->
						<?php 
                }
            }
            ?>
				</div>
			</div>	
		<?php 
        }
Example #2
0
        ?>
							<?php 
        _e('Both comments and trackbacks are currently closed.', 'fruitful');
        ?>
						<?php 
    }
    ?>
						<?php 
    edit_post_link(__('Edit', 'fruitful'), ' <span class="edit-link">', '</span>');
    ?>
					</footer><!-- .entry-meta -->
				</article><!-- #post-<?php 
    the_ID();
    ?>
 -->

				<?php 
    if (fruitful_state_page_comment()) {
        comments_template('', true);
    }
    ?>
			<?php 
}
// end of the loop.
?>

			</div><!-- #content .site-content -->
		</div><!-- #primary .content-area .image-attachment -->

<?php 
get_footer();