- This topic has 5 replies, 2 voices, and was last updated 6 years ago by
Tom.
-
AuthorPosts
-
November 25, 2017 at 4:51 pm #434214
Cindy
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!
November 25, 2017 at 9:20 pm #434329Tom
Lead DeveloperLead DeveloperHi 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 ); }
November 26, 2017 at 1:15 pm #434946Cindy
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.
November 26, 2017 at 6:11 pm #435127Tom
Lead DeveloperLead DeveloperNo templates currently, but one day!
No problem at all – let me know if you need more help π
November 26, 2017 at 8:13 pm #435203Cindy
Thanks again! And please let me know if you ever do templates on that plugin. π
November 26, 2017 at 10:26 pm #435295Tom
Lead DeveloperLead DeveloperWill do π
-
AuthorPosts
- You must be logged in to reply to this topic.