Full lenght post in category

Hi, not sure I’m doing this right but here I go.
I got a category in the menu “Nyheter” and when pressing that I would like the posts to be displayed full lenght on that archive page.

Is this possible?

Thanks in advance.

Hello @Lisali,

Thanks for writing in!

Yes, that’s possible but please note that this will require custom development and falls outside scope of the support we offer. However I can point you in right direction and you will have to take it up from there to implement on website.

First, please download and install child theme from here. Then copy _content.php from /wp-content/themes/x/framework/views/global/ and paste it into child theme’s path: /wp-content/themes/x-child/framework/views/global/_content.php

Now, replace existing code with following:

<?php

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

$stack                     = x_get_stack();
$is_full_post_content_blog = is_home() && x_get_option( 'x_blog_enable_full_post_content' ) == '1';

?>

<?php

if ( is_singular() || $is_full_post_content_blog || is_archive() ) :

  x_get_view( 'global', '_content', 'the-content' );
  if ( $stack == 'renew' ) :
    x_get_view( 'renew', '_content', 'post-footer' );
  endif;
else :
  x_get_view( 'global', '_content', 'the-excerpt' );
endif;

?>

Thanks.

Thank you very much! It worked perfectly!
Have a lovely day!
//
Lisa

Hey Lisa,

You’re most welcome! We are just glad we were able to help you out.
Thanks for letting us know that it has worked for you.

Cheers.

Hi, I tried to implement this solution on Pro with Integrity, and pro-child, but it didn’t work.
Can you help me please?

Hi,

The code should work in pro as well.

Make sure you have added the file in /wp-content/themes/pro-child/framework/views/global/_content.php

If it still doesn’t work, kindly open a new topic and provide us your wordpress and ftp login in Secure Note

Thanks