With this code:
get_template_part('content', 'page' );
WordPress will try to load a file called content-page.php
and if this file doesn’t exist then it will try to load content.php
. Your theme seems to have the file content-page.php
, so if you want to load content.php
you should use:
get_template_part('content');
EDIT: You have edited the question and delete the code with this issue with the get_template_part()
. I think is better keep the original code in the question and, in any case, add the new code with new comments.
About why the content-template is not showing any blog-entries: if you are using the template as you have posted and it is a template for a ‘page’ (as the name content-page.php
suggests as well the name page-one.php
where you said it dosen’t work), you need to run some code to get the posts you want to show before starting the loop; the query made by WordPress was only the query needed to get the actual ‘page’. A quick example:
<div class="primary">
<div id="content">
<?php wplook_doctitle(); ?>
<?php
// See the docu for more arguments: http://codex.wordpress.org/Class_Reference/WP_Query
$the_query = new WP_Query('showposts=5' . '&paged='.$paged);
if ( $the_query->have_posts() ) : ?>
<?php /* Start the Loop */ ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="col1 fleft">
<div class="postformat">
<div class="format-icon"></div>
<div class="left-corner"></div>
</div>
</div>
<div class="col2 fright">
<header class="entry-header">
<h1 class="entry-title"><a href="https://wordpress.stackexchange.com/questions/114938/<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'wplook' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
</header>
<div class="entry-content">
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="clear"></div><div class="page-link"><span>' . __( 'Pages:', 'wplook' ) . '</span>', 'after' => '</div>' ) ); ?>
<!-- .entry-content -->
<div class="clear"></div>
<div class="entry-utility">
<?php if ( the_category ( '', ', ' ) ) { ?>
<div class="category">
<b><?php _e('Category:', 'wplook'); ?></b>
<?php the_category(', ') ?>
<div class="end"></div>
</div>
<?php } ?>
<?php if ( get_the_tag_list( '', ', ' ) ) { ?>
<div class="tag">
<b><?php _e('Tag:', 'wplook'); ?></b>
<?php echo get_the_tag_list('',', ',''); ?>
<div class="end"></div>
</div>
<?php } ?>
</div>
<div class="clear"></div>
</div><!-- .entry-content -->
<footer class="entry-meta">
<div class="date-i fleft"><a href="https://wordpress.stackexchange.com/questions/114938/<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'wplook' ), the_title_attribute( 'echo=0' ) ); ?>" rel="nofollow"><?php wplook_get_date_time();?></a></div>
<?php if ( comments_open() ) : ?>
<div class="comment-i fleft"><?php comments_popup_link(__('No comments', 'wplook'), __('1 comment', 'wplook'), __('% comments', 'wplook'), 'comments-link', __('Comments off', 'wplook')); ?></div>
<?php endif; ?>
<div class="author-i fleft"><?php wplook_get_author();?></div>
<?php edit_post_link( __( 'Edit', 'wplook' ), '<div class="edit-i fright">', '</div>' ); ?>
<div class="clear"></div>
</footer>
</div>
<div class="clear"></div>
</article>
<?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_postdata(); ?>
</div><!-- #content -->
</div><!-- #primary -->