Instead of trim words how to add custom excerpt in wordpress
First go to blog posts and edit one.
Now you will not see here any input to type custom excerpt for this post.
In Post menu in right sidebar you will see add excerpt in top.
Add dummy excerpt in this post and update.
Now go to front-page.php and find blog section where we added 18 words trim function. lets modify here
Now change that code with below
and save that.
Now add this feature in event posts
go to any event and edit one and add excerpt.
With edit event post you will not see excerpt option and also there is classic editor.
Means we have to tell wordpress to support excerpt feature by code.
So go to mu-plugins folder and open custom post type code for event.
so add this line in custom post type function
and save.
and also if you want modern editor not classic so update custom post type function with below line
and save.
and for event post in front-page.php display excerpt use above code like post.
and also add below code for view all events
Comments
Post a Comment