I have an issue where I need to display the full posts in my archive page.
E.G. I have >two posts and I would like to have EACH of them displayed in full in the archive page. Thanks!
How would I do this with the hueman theme?
Here is the contents of the archive.php theme:
<?php get_header(); ?>
<section class="content">
<?php get_template_part('inc/page-title'); ?>
<?php if(function_exists('pf_show_link')){echo pf_show_link();} ?>
<div class="pad group">
<?php if ((category_description() != '') && !is_paged()) : ?>
<div class="notebox">
<?php echo category_description(); ?>
</div>
<?php endif; ?>
<?php if ( have_posts() ) : ?>
<div class="post-list group">
<?php $i = 1; echo '<div class="post-row">'; while ( have_posts() ): the_post(); ?>
<?php get_template_part('content'); ?>
<?php if($i % 2 == 0) { echo '</div><div class="post-row">'; } $i++; endwhile; echo '</div>'; ?>
</div><!--/.post-list-->
<?php get_template_part('inc/pagination'); ?>
<?php endif; ?>
</div><!--/.pad-->
</section><!--/.content-->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Here is the content.php file:
" >
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php if ( has_post_thumbnail() ): ?>
<?php the_post_thumbnail('thumb-medium'); ?>
<?php elseif ( ot_get_option('placeholder') != 'off' ): ?>
<img src="<?php echo get_template_directory_uri(); ?>/img/thumb-medium.png" alt="<?php the_title(); ?>" />
<?php endif; ?>
<?php if ( has_post_format('video') && !is_sticky() ) echo'<span class="thumb-icon"><i class="fa fa-play"></i></span>'; ?>
<?php if ( has_post_format('audio') && !is_sticky() ) echo'<span class="thumb-icon"><i class="fa fa-volume-up"></i></span>'; ?>
<?php if ( is_sticky() ) echo'<span class="thumb-icon"><i class="fa fa-star"></i></span>'; ?>
</a>
<?php if ( comments_open() && ( ot_get_option( 'comment-count' ) != 'off' ) ): ?>
<a class="post-comments" href="<?php comments_link(); ?>"><span><i class="fa fa-comments-o"></i><?php comments_number( '0', '1', '%' ); ?></span></a>
<?php endif; ?>
</div><!--/.post-thumbnail-->
<div class="post-meta group">
<p class="post-category"><?php the_category(' / '); ?></p>
<p class="post-date"><?php the_time('j M, Y'); ?></p>
</div><!--/.post-meta-->
<h2 class="post-title">
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
</h2><!--/.post-title-->
<?php if (ot_get_option('excerpt-length') != '0'): ?>
<div class="entry excerpt">
<?php the_excerpt(); ?>
</div><!--/.entry-->
<?php endif; ?>
</div><!--/.post-inner-->
Thanks for your interest!
I have an issue where I need to display the full posts in my archive page.
E.G. I have >two posts and I would like to have EACH of them displayed in full in the archive page. Thanks!
How would I do this with the hueman theme?
Here is the contents of the archive.php theme:
<?php get_header(); ?>
<section class="content">
<?php get_template_part('inc/page-title'); ?>
<?php if(function_exists('pf_show_link')){echo pf_show_link();} ?>
<div class="pad group">
<?php if ((category_description() != '') && !is_paged()) : ?>
<div class="notebox">
<?php echo category_description(); ?>
</div>
<?php endif; ?>
<?php if ( have_posts() ) : ?>
<div class="post-list group">
<?php $i = 1; echo '<div class="post-row">'; while ( have_posts() ): the_post(); ?>
<?php get_template_part('content'); ?>
<?php if($i % 2 == 0) { echo '</div><div class="post-row">'; } $i++; endwhile; echo '</div>'; ?>
</div><!--/.post-list-->
<?php get_template_part('inc/pagination'); ?>
<?php endif; ?>
</div><!--/.pad-->
</section><!--/.content-->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Here is the content.php file:
" >
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php if ( has_post_thumbnail() ): ?>
<?php the_post_thumbnail('thumb-medium'); ?>
<?php elseif ( ot_get_option('placeholder') != 'off' ): ?>
<img src="<?php echo get_template_directory_uri(); ?>/img/thumb-medium.png" alt="<?php the_title(); ?>" />
<?php endif; ?>
<?php if ( has_post_format('video') && !is_sticky() ) echo'<span class="thumb-icon"><i class="fa fa-play"></i></span>'; ?>
<?php if ( has_post_format('audio') && !is_sticky() ) echo'<span class="thumb-icon"><i class="fa fa-volume-up"></i></span>'; ?>
<?php if ( is_sticky() ) echo'<span class="thumb-icon"><i class="fa fa-star"></i></span>'; ?>
</a>
<?php if ( comments_open() && ( ot_get_option( 'comment-count' ) != 'off' ) ): ?>
<a class="post-comments" href="<?php comments_link(); ?>"><span><i class="fa fa-comments-o"></i><?php comments_number( '0', '1', '%' ); ?></span></a>
<?php endif; ?>
</div><!--/.post-thumbnail-->
<div class="post-meta group">
<p class="post-category"><?php the_category(' / '); ?></p>
<p class="post-date"><?php the_time('j M, Y'); ?></p>
</div><!--/.post-meta-->
<h2 class="post-title">
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
</h2><!--/.post-title-->
<?php if (ot_get_option('excerpt-length') != '0'): ?>
<div class="entry excerpt">
<?php the_excerpt(); ?>
</div><!--/.entry-->
<?php endif; ?>
</div><!--/.post-inner-->
Thanks for your interest!
Share Improve this question edited Apr 17, 2014 at 23:16 Elliot Huffman asked Apr 17, 2014 at 18:09 Elliot HuffmanElliot Huffman 1299 bronze badges 13 | Show 8 more comments1 Answer
Reset to default 1You need to do the following in a child theme, do not make changes to the theme itself.
EDIT
I had a good look at the 'Heuman' theme. I think to solve your problem here is to copy the following files to your child theme, content.php
and archive.php
Rename your content.php
to something like content-archive.php
. Open it up and delete the following lines
<?php if (ot_get_option('excerpt-length') != '0'): ?>
<div class="entry excerpt">
<?php the_excerpt(); ?>
</div><!--/.entry-->
<?php endif; ?>
and replace it with
<div class="entry content">
<?php the_content(); ?>
</div><!--/.entry-->
Next, open up your archive.php
and replace he following line
<?php get_template_part('content'); ?>
with
<?php get_template_part('content', 'archive'); ?>
That should solve your problem
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745212385a4616920.html
<?php the_content(); ?>
php code snip bit but that only shows the full most recent post. – Elliot Huffman Commented Apr 17, 2014 at 18:25the_content()
is the correct function, so you must not have it in the right place. Not familiar with the theme to correct you, but agree with Pieter's suggestion of a child theme. – helgatheviking Commented Apr 17, 2014 at 19:42archive.php
code you posted doesn't call eitherthe_content()
orthe_excerpt()
. You probably need to look incontent.php
, which is included inarchive.php
viaget_template_part( 'content' )
. – Chip Bennett Commented Apr 17, 2014 at 22:38