Display only title on the archive page

Work well with numerical pagination / Twelve twenty theme / WordPress

Results

 

1. Make a Child Theme / I used Child Theme Configurator
2. Copy archive.php (for date archive), category.php and tag.php from original to child theme.
3. Delete
Under class “comments-link”

comments_popup_link( '' . __( 'Leave a reply', 'twentytwelve' ) . '', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) )

Under class “entry-content”

the_content( __( 'Continue reading ', 'twentytwelve' ) )

Under class “entry-meta”

edit_post_link( __( 'Edit', 'twentytwelve' ), '', '' )

4. Copy the content.php from the original Theme and paste in Child Theme with different name such as content-title.php 
5. Modify

 get_template_part( 'content', get_post_format() );

->

 get_template_part( 'content-title', get_post_format() );

Then done!
We can see post title list on archive page.

+ Instead of “category/tag archive: tag/category-name” -> looks like sub-title “tag/category-name”

and make the title list gap narrower

.archive #content .post {
		margin-bottom: 0px;
    position: relative;
	  padding-bottom: 0px;
}

.archive #content .comments-link {
    position: absolute;
    bottom: 0px;
}

.archive .entry-header .entry-title a
{
		font-size:medium;
	}

.archive .entry-meta{	 	 
 visibility: hidden;	 	 
 height:0;	 	 
 margin:0;	 	 
 padding-bottom:0;	 	 
}	
.archive .archive-title{	 	 
 font-size:0;	 	 
}	 	 
.archive .archive-title span{	 	 
 font-size:20px;	 	 
}	 	 
.archive .archive-header{	 	 
 margin:0;	 	 
}	 	 
.archive #primary{	 	 
 margin-top:0;	 	 
}	 	 
.archive .archive-meta{	 	 
 font-size:15px;	 	 
}
.archive .entry-header{	 	 
 margin:0.5em
}	 

 

++ Additionally

Want to show more posts in Archive page rather than Home page

Number of post per Home page = 3 ; modified from setting -> Reading

Number of post per Archive page = 10 ; For showing more number of post as title list.
-> add following function function.php  in child theme

function wpsites_query( $query ) {
if ( $query->is_archive() && $query->is_main_query() && !is_admin() ) {
$query->set( 'posts_per_page', 10 );
}
}
add_action( 'pre_get_posts', 'wpsites_query' );

Leave a Reply