- This topic has 28 replies, 3 voices, and was last updated 4 years, 10 months ago by Hasan.
-
AuthorPosts
-
June 11, 2019 at 9:07 am #926111DavidStaffCustomer Support
You can set the excerpt to 0 in the Customizer > Layout > Blog
WP Show Posts has its own control for the excerpt.
Or what am i missing?June 11, 2019 at 9:41 am #926138HasanThe excerpt length is already set to 0 in the customizer: http://prntscr.com/o0k8u8
Seems like it does not work for the manual excerpts. I have set manual excerpt for only one page, which is being shown here: https://snapbangladesh.com/
Setting the excerpt length to 0 on the show post settings does not affect the archive pages: http://prntscr.com/o0ka2k
Any idea?
June 11, 2019 at 9:46 am #926141DavidStaffCustomer SupportAah – only Auto Excerpts can be limited in length by the customizer.
May i ask why the manual excerpt if you’re not going to display it?June 11, 2019 at 9:56 am #926155HasanIn the show post list here, I’ve set the excerpt length from the show posts settings to 70 word, which shows the full paragraph when I have small text on any post.
But if the post is with long text, it shows exactly 70 words and shows “…” in the end, combining the paragraphs and removing the gap between the paragraphs, which does not look good. On this case, if I provide a manual excerpt, it shows one full paragraph nicely, hence the necessity of using manual excerpt for the long posts.
Will appreciate any idea to stop it being generated on the archive pages.
June 11, 2019 at 10:43 am #926194LeoStaffCustomer SupportI don’t believe there is a way to overwrite manual excerpt as that kind of defeats the purpose as David mentioned.
If it’s just for one post maybe we can try CSS to hide it?
Can you link me to the page in question and direct me to the post?
June 11, 2019 at 10:52 am #926202HasanThis is not for just one post. Will be many many posts when the site is fully developed. So hiding with CSS is not an option.
Here is the archive page: https://snapbangladesh.com/stories/
Here is the long post in question: https://snapbangladesh.com/ahsan-manzil-pink-palace-old-dhaka-front-view-2/
And the show post list: https://snapbangladesh.com/stories/June 11, 2019 at 10:57 am #926208LeoStaffCustomer SupportUnfortunately I don’t believe there is a way to go around it without some custom solution.
Custom excerpt (a WordPress core function) is meant to be displayed when used.
You could try asking WordPress’ support to see if they have any workaround solution or a forum like this:
https://stackoverflow.com/June 11, 2019 at 11:35 am #926233Hasan/* Remove excerpts from the achrive pages only */ add_filter( 'wp_trim_excerpt', 'db_excerpt_metabox_remove' ); function db_excerpt_metabox_remove( $excerpt ) { $output = $excerpt; if ( is_archive() && has_excerpt() ) { $output = ''; } return $output; }
Got this code from an old support thread, which should remove the manual excerpt from the archive pages. Any idea why this does not work?
June 11, 2019 at 11:43 am #926241LeoStaffCustomer SupportHere is the archive page: https://snapbangladesh.com/stories/
This is actually just a static page and not an archive page.
June 11, 2019 at 11:58 am #926257HasanThis is strange! On further research, using the last code I posted actually removes the manual excerpt from the archive pages: https://snapbangladesh.com/tag/dhaka/
But not from the home page, which is also an archive of posts: https://snapbangladesh.com/
Any idea?
June 11, 2019 at 12:03 pm #926261LeoStaffCustomer SupportHome page as posts page requires the other conditional tag:
https://codex.wordpress.org/Conditional_Tags#The_Main_PageJune 11, 2019 at 12:27 pm #926274HasanModified the code as the follows, and it resolved the issue – if it helps someone else in future:
/* Remove excerpts from the achrive pages only */ add_filter( 'wp_trim_excerpt', 'db_excerpt_metabox_remove' ); function db_excerpt_metabox_remove( $excerpt ) { $output = $excerpt; if ( is_archive() && has_excerpt() ) { $output = ''; } elseif ( is_home() && has_excerpt() ) { $output = ''; } return $output; }
Thanks Leo for pointing toward this! Apparently it was not impossible to do.
Thank you so much David for going above and beyond to resolve this issue! I’ve experience of working with support of several top selling themes, but I can honestly say, from you I’ve received the best theme support ever! Kudos!! ๐
June 11, 2019 at 12:42 pm #926283LeoStaffCustomer SupportGlad we could help ๐
Please note that WP Show Posts is actually separate support forums:
Free: https://wordpress.org/support/plugin/wp-show-posts/
Premium: https://wpshowposts.com/support/area/pro-support/Please consider using them in the future.
Thanks for your support!
June 12, 2019 at 3:51 am #926745HasanNo problem!
-
AuthorPosts
- You must be logged in to reply to this topic.