Felikss Veilands
asked 6 years ago

Hi,
DW Social Feed is great plugin, but there is one big problem. I use Wall Classic theme and feeds are to long for category view. I tried different auto excerpt plugins but all of them damage the theme. Also, I tried to add excerpt filter to theme functions.php file but without success. 
Is there a way to show excerpt instead of full post in category view? The best, if there is option to show excerpts for specified category(ies).
 
 

5 Answers
BigHug
answered 6 years ago

If you want to show all the content of your post on homepage, go to <wallpress>/home.php add this code after line 15

$wp_query->is_archive = false;

 

BigHug
answered 6 years ago

Hi Felikss,
If you want to trim down the length of post that was shown up on archive page, please go to `functions.php` of wallpress theme folder and add this following code:

function custom_excerpt_length( $length ) {
return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length' );

You can replace 20 by another option for your content length. Then, go to `content.php` at line 69, please replace

the_content();

by

the_excerpt();

Hope this helps!

Felikss Veilands
answered 6 years ago

Thank you Rambu, but this not solve my problem.
It damage my Quotes posts and it not respect my custom “more” setups in posts. I need excerpt function only for posts which coming from DW Social Feed plugin.
I tried your code and also I tried this

function custom_excerpt_length( $length ) {

if(in_category(393)) {
return 20;
} else {
return 200;
}
}
add_filter( ‘excerpt_length’, ‘custom_excerpt_length’ );

but without success.
Anyway – thank you for help!

BigHug
answered 6 years ago

In your content.php file, please edit  line 66 to 

     <?php if ( is_search() || is_archive() || is_category(393)  ) :  ?>

And use excerpt_length filter normally.
Regards

Felikss Veilands
answered 6 years ago

Thanks again, Rambu!
almost good 🙂 excerpt in necessary category is good, but there is problems in main page (see image):

 
any ideas?

Felikss Veilands
answered 6 years ago

Thank you Rambu,
like always – works perfect! 🙂

Powered by DW Question & Answer Pro