Archived topic
Having trouble with the BLOG addon
5 replies · Started by Cindy on November 25, 2017
Hi again, I'm stumped with this one, I've been using a plugin called Ultimate Posts Widget to display certain custom posts throughout my site - in some cases I need to have a longer excerpt and in others a shorter one, and with this plugin I'm able to set them on a case by case basis.
When I turn on the Blog addon in GP, GP's custom excerpt length takes over what I have set individually in the widgets (and displays an extra 'read more' link unless I turn one of them off). If I turn off the Blog addon, then I have to turn off the featured image on every single page, and I lose any formatting I've set on my archive pages, so then I'd have to create new archive pages.
I'm thinking the best (easiest for me lol) way to deal with this is to keep the Blog addon enabled, and somehow disable the excerpt length that GP is setting - at least for a couple of my custom post types that I need to set individually. Or any query that's coming from the Ultimate Posts Widget plugin. Is there any possible way to do that? Or if you have any ideas that would help, thanks!
Hi Cindy,
Technically, that plugin should remove any filters like the excerpt length and read more link for its specific page. That's how WP Show Posts works.
You can disable these yourself globally with a little PHP:
add_action( 'after_setup_theme', 'tu_remove_blog_filters' );
function tu_remove_blog_filters() {
remove_filter( 'excerpt_length', 'generate_excerpt_length', 15 );
remove_filter( 'excerpt_more', 'generate_blog_excerpt_more', 15 );
remove_filter( 'the_content_more_link', 'generate_blog_content_more', 15 );
}
Oh that's your plugin, I actually installed the free version and I like the way it works. I looked at the pro version video but couldn't see if it had customizable templates? If that's an option I'll buy it! :)
Thanks for the code in the meantime, I actually tried something similar but it didn't work, maybe I didn't do a high enough priority number.
No templates currently, but one day!
No problem at all - let me know if you need more help :)
Thanks again! And please let me know if you ever do templates on that plugin. :)
Will do :)