Full post content on category page

Hi! I’m wondering if it’s possible to enable full post content on category pages?

Hello @artemy_makeev,

Thanks for writing in!

What you are looking to implement requires custom modifications which falls outside scope of the support we offer. But I can point you in right direction believing that it would be your responsibility to implement. Please note that custom code can present unexpected outcomes in future and it would be your responsibility to fix the same.

Before making any changes we suggest you to setup child theme. Next, you need to copy _content-the-excerpt.php from /x/framework/views/global/ to /x-child/framework/views/global/ (you may have to create necessary folders in child theme).

Then replace existing code with following:

<?php

// =============================================================================
// VIEWS/GLOBAL/_CONTENT-THE-EXCERPT.PHP
// -----------------------------------------------------------------------------
// Display of the_excerpt() for various entries.
// =============================================================================

?>

<?php do_action( 'x_before_the_excerpt_begin' ); ?>

<div class="entry-content excerpt">

<?php do_action( 'x_after_the_excerpt_begin' ); ?>

<?php the_content(); ?>

<?php do_action( 'x_before_the_excerpt_end' ); ?>

</div>

<?php do_action( 'x_after_the_excerpt_end' ); ?>

You can download child theme from following source: https://theme.co/apex/child-themes

To setup child theme you can refer following documentation:

Thanks.

Thanks! It works! Also, it would be great to have some kind of switch for this. This doesn’t look like feature that is very hard to implement, but I think most people who use “enable full post content on index” want to see the same thing on category pages. Thanks!

Hello @artemy_makeev,

Sure, I have added this to our todo list. Please note that internally we have scoring tool that helps us to prioritise which features to develop depending on number of requests and usefulness.

Thanks.

This solution worked for my needs also. If anybody else is thinking about it:

Prasant’s mod breaks the the_excerpt() function and turns ALL excerpts into full posts. If you do this, you can’t have any excerpts anywhere. That includes the index, archives, and categories. The “Full Post Content on Index” option becomes functionless, because both the content and excerpt functions call the_content().

I second Artemy’s request for toggles for full/excerpt display in Categories and Archives. It would be nice to have those options, and I’m guessing just a little bit of extra logic in /views/global/_content.php would do it. (Unfortunately it’s a little outside of my capabilities.)

Little update: I just found a solution which allows full post display for categories WITHOUT BREAKING THE EXCERPT FUNCTION. This is better than the solution Prasant suggested above.

/views/global/_content.php outputs the posts for us and decides to call either the_content or the_excerpt.
Line 16 determines which pages get the full content. It reads:
if ( is_singular() || $is_full_post_content_blog ) :

Adding another OR statement can easily add categories to the list of pages which get the full posts. This does NOT break the excerpt function, so the archives and other things can still use excerpts.
if ( is_singular() || $is_full_post_content_blog || is_category() ) :

I tried to also exclude archives by year, month, and day, but this FAILED and I couldn’t figure out why.
if ( is_singular() || $is_full_post_content_blog || is_category() || is_year() || is_month() || is_day() ) :

Conclusion:

If you don’t want any excerpts anywhere on your site ever, make the mod Prasant suggested to views/global/_content-the-excerpt.php. It’s a bit sloppy and confusing to mod the_excerpt() to output the full content, but it gets the job done.

If you only want to give categories the full posts (the original request from Artemy) then make my mod to /views/global/_content.php. It’s a more honest solution which still uses the_content() and the_excerpt() for their intended purposes. The toggle option in Customize > Blog > Full Post Content on Index is not broken and the archive excerpt displays are unaffected.

Hopefully somebody else can figure out the trick for archive pages.

1 Like

Hello There,

We are just glad that you have figured out a way to resolve your issue.
And thank you for sharing the solution which is very helpful to other users.

Best Regards.