Changing Category Page Formatting in Pilcrow Theme

Changing Category Page Formatting in Pilcrow Theme

No Comments

A WordPress user on Reddit asked, “I’d like for category links to show the full content of articles instead of just excerpts. google isn’t helping“.  The answer lays in the loop.php file of the theme.  Around line 66 in version 1.0 of the theme there are a series of if/else statements which define how to format the Archive, Search and Default layout.  Category is not specifically defined, so WordPress treats it as a Category per the template hierarchy.

By replacing the default code:

 

<?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?> <div> <?php the_excerpt(); ?> </div><!– .entry-summary –> <?php else : ?> <div> <?php the_content( __( ‘Continue reading <span>&rarr;</span>’, ‘pilcrow’ ) ); ?> <?php wp_link_pages( array( ‘before’ => ‘<div>’ . __( ‘Pages:’, ‘pilcrow’ ), ‘after’ => ‘</div>’ ) ); ?> </div><!– .entry-content –> <?php endif; ?>

With the following:

<?php if ( is_category() ) : // Dispaly the content for Categories ?> <div> <?php the_content(); ?> </div><!– .entry-summary –> <?php elseif ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?> <div> <?php the_excerpt(); ?> </div><!– .entry-summary –> <?php else : ?> <div> <?php the_content( __( ‘Continue reading <span>&rarr;</span>’, ‘pilcrow’ ) ); ?> <?php wp_link_pages( array( ‘before’ => ‘<div>’ . __( ‘Pages:’, ‘pilcrow’ ), ‘after’ => ‘</div>’ ) ); ?> </div><!– .entry-content –> <?php endif; ?>

All Category pages will now more closely resemble the Default page layout seen on the home page of the theme.  If you only need this change for one specific category, you can specify by Category ID or Slug like so:

<?php if ( is_category(’10’) ) :

Where 10 is a ID of the Category you wish to alter.

I'm the front-man of It's WordPress. I come from a diverse array of backgrounds, enjoying the opportunity to expand my knowledge base and skill set by re-inventing myself. I enjoy environments that focus on emerging information, technology and concepts. I put on the technical hat in my early 20s and never really looked back. I'm love technology and the internet, as well as the outdoors and avidly hike, kayak and camp every chance I get.

About Us

We can take you from concept, through design, development and deployment in one seamless process. Whether you choose a self-managed web site or need a continuing support relationship; we've got you covered.

CLICK TO EDIT

Request Consulation

Ready to transform your vision into a reality? Just looking to see what it takes to get the ball rolling. Tell us about your project and we can help. No spam. No obligation. Just answers.

WordPress Workflow With Rest API

Over the last decade we've seen the accelerating rise of dynamic JavaScript…
Continue reading

Three Must-Haves For Your WordPress Headlines

Simple headline best practices you can't afford to overlook. Don't bury the…
Continue reading

Hail to the King (of Content Management Systems)!

WordPress continues to grow as the CMS (Content Management System) of choice on…
Continue reading

Theme View – Cool Free Themes For WordPress Sites

In this post we look at three free themes that use the…
Continue reading

A Fist Full of Facebook… Plugins

Love or hate it, Facebook is still the 800 pound gorilla in…
Continue reading

Modifying the WordPress Admin Toolbar

The Admin Toolbar was introduced back in WordPress 3.1 (trivia points if…
Continue reading

Defer Ads by Date on WordPress Post and Pages

The topic of advertising on a website can be a sensitive one.…
Continue reading

Theme View – Cool Free Themes For WordPress Sites

In this Theme View update we feature themes that take advantage of…
Continue reading

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top