How to shorten excerpt

Posted in: Newspaper
Post count: 84

Hi,

I’m upgrading to your latest version but I have a problem. I use module 16 for my category page (http://churchandstate.org.uk/category/books/).

A few years ago I had the same issue and you kindly helped me (https://forum.tagdiv.com/topic/excerpts-2/).

However, that doesn’t work now. In fact nothing works, including:

<div class=”td-excerpt”>
<?php echo wp_trim_words(get_the_excerpt(), 30); ?>
</div>

I am testing the theme in a local installation so I can’t give you a link.

What should I do to create a condition for module 16 excerpt lenght only for category page?

Lola

Post count: 20688

Hi,

The theme modules are now in the composer plugin, after the theme update 9.7 there were changes to the theme file location – https://tagdiv.com/updating-the-core-of-tagdiv-themes/
So now the module files are in the tagDiv composer plugin – http://prntscr.com/ngl60o and the composer has to be activated at all times to maintain the same functionality as before.

If you made this modification to the module in a child theme, this will not work same as before. You could modify the module you want in the composer, but it will have to be made again after each update of the plugin.

However in the theme panel you can set a custom excerpt length for each module
http://prntscr.com/ngl7jv
So you could use the settings in the theme panel to set the length you want for module 16. Does this not work for you?

Thanks

Post count: 84

Hi,

The panel doesn’t do anything to shorten the excerpts in the category pages which is why you had to tell me what to amend more than three years ago. But now that you told me where to look it is resolved. The file had moved as you said. 🙂

I have found other problems in the new version of the theme. Should I use this thread or do I start a new one?

Many thanks.

Post count: 20688

Hi,

The excerpt settings are per module, regardless of where they are located. So for example if I use module 1 to display posts in a category page – http://prntscr.com/nijw27
http://prntscr.com/nijw8h
the excerpt setting will affect it – http://prntscr.com/nijwfvhttp://prntscr.com/nijwi1
Which module are you using in the respective category page or pages? I will make more tests on my end, if there is a problem we will fix it. Let me know.

Also if you have other problems please mention them, here or in a new topic.

Thanks

Post count: 84

It has been resolved as I mentioned. I just had to look in the plugin folder to find the file td_module_16.php. I had to put in this line (<?php echo wp_trim_words(get_the_excerpt(), 25); ?>) instead of the one you have.

But just to let you know that without that line, the category page excerpts would take whatever it was written in the excerpt.

Post count: 20688

I will make more tests on my end, if there is a problem it will be fixed. Quite unusual what is happening in your case.

Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘Newspaper’ is closed to new topics and replies.