Forums

Blog page is blank / empty (4 posts)

  1. tomlis20
    Member
    Posted 9 months ago #

    Hello,

    I have read plenty articles about my blog-not-showing-up problem but actually none of them solves it.

    I have set blog page in Settings -> Reading as 'Blog' then I have created page called the same with my new template (bloggy.php). That is the code:

    <?php
    /**
     Template Name: Bloggy
     */
    
    get_header(); ?>
    
    		<div class="body">
    
    			<?php if ( have_posts() ) : ?>
    
    				<?php twentyeleven_content_nav( 'nav-above' ); ?>
    
    				<?php /* Start the Loop */ ?>
    				<?php while ( have_posts() ) : the_post(); ?>
    
    					<?php get_template_part( 'content', get_post_format() ); ?>
    
    				<?php endwhile; ?>
    
    				<?php twentyeleven_content_nav( 'nav-below' ); ?>
    
    			<?php else : ?>
    
    				<article id="post-0" class="post no-results not-found">
    					<header class="entry-header">
    						<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
    					</header><!-- .entry-header -->
    
    					<div class="entry-content">
    						<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
    						<?php get_search_form(); ?>
    					</div><!-- .entry-content -->
    				</article><!-- #post-0 -->
    
    			<?php endif; ?>
    
            </div>
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    As I mentioned in introduction to this post - Blog page is completly blank. No posts, no title, comments.. anything. What am I doing wrong? Is the code bad?

    My theme is called "abk". Should I change all of the function's names to i.e. abk_content_nav?

    If its helpful for you, I include mine "page.php" file:

    <?php
    get_header(); ?>
    
    		<div class="body">
    
    			<?php
    			/* Run the loop to output the page.
    			 * If you want to overload this in a child theme then include a file
    			 * called loop-page.php and that will be used instead.
    			 */
    			get_template_part( 'loop', 'page' );
    			?>
    
                <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Flash-Area') ) : ?>
     			<?php endif; ?>
    
    			<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('All-Page-Area-1') ) : ?>
     			<?php endif; ?>
    		</div>
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Thanks in advance.
    Tomasz.

  2. Abooze
    Member
    Posted 9 months ago #

    Just select the option "Your latest posts" in Settings -> Reading.
    Then Create a page (say Blog Page) and simply assign the above page template to the same.
    It should be worked in that way. Else, try with querying posts:

    <?php query_posts('showposts');
    if ( have_posts() ) : ?>
    ***
    ***
    ***
    <?php endif;
      wp_reset_query();
    ?>
  3. tomlis20
    Member
    Posted 9 months ago #

    I believe that I cannot just change to "Your latest post" option because I have set my front page as well. It must work with the division of Front Page and Blog Page.

  4. Abooze
    Member
    Posted 9 months ago #

    So, why don't you try to code the home page contents in the index.php? It will work.

Reply

You must log in to post.

About this Topic