You can use get_post_type
add_filter('excerpt_more', 'new_excerpt_more');
function new_excerpt_more($more) {
global $post;
$post_type = get_post_type($post);
switch( $post_type ):
case 'event':
$teaser="<a class="moretag" href="". get_permalink($post->ID) . '"> More events </a>';
break;
case 'post':
$teaser="<a class="moretag" href="". get_permalink($post->ID) . '"> … </a>';
break;
default
$teaser="";
endswitch;
return $teaser;
}
Related Posts:
- How do I filter the excerpt metabox description in admin?
- the_content filter on some post types only not working
- How can I remove filters from custom post types?
- How do I show a link or ‘Read More’ button on a custom field excerpt when it is less than the word limit
- Auto generate excerpt from ACF field on a CPT that does not support excerpt or content
- Filter Content on all Post Types
- How to change the post type a theme shows by default?
- filter custom post in rest api with custom function
- Content vs Template on custom post
- Filter hierarchical custom post type admin page by parent, and include children & grandchildren
- Sort and filter custom post type posts by custom taxonomy
- Versioned Custom Post Type (Not the same as revisions)
- Loop filtering Custom Post Types and/or Categories
- search suggest – filter post type
- Adding the_content() in custom template email
- Filtering posts list table
- Custom filter function not working with Custom post type
- Filter Posts from the Main Query
- Categories filtering in new post
- Is it better to use filter for the_content in archive pages?
- How to use manage_$post_type_posts_columns with underscore in post type?
- How does the filter post_updated_messages work?
- Search filter triggered & sort by custom post type
- How to order posts of a custom post type by date DESC in dashboard Admin?
- How can I add a filter to a particular post format?
- Is there any way to get list of all possible filter hooks for all post types?
- Can I display custom post types in home.php or need page template?
- Create new custom post and post category of same name
- wordpress remove views from action links in a custom post
- custom post data – how to
- the_content(); of custom post type treated as an array or object
- wp_insert_post wrong post type [closed]
- Excerpt is being added above the content, but it should be after it
- Dynamic bootstrap tabs with post_title doesn’t display the_content
- Excerpt function for any content
- Filter posts by tax (dropdown) and meta value
- sortable columns for multiple custom post types not working
- I need to add a filter to prepend the term ‘National – ‘ to the post title if the post is tagged to multiple states
- How do I add custom HTML to the content of an archive page’s posts?
- Only show posts with a specific term of an associated taxonomy in a custom post type archive
- REST filters only firing when I have a param set
- Add shortcode inside of the_content()
- Problem with Apply Filters on URL in meta box filed of custom port type
- how to retain the ability to modify the post slug after applying a post_type_link filter?
- Separate Content from gallery (custom post type)
- How to filter url on post submission?
- Modifying WP_Title For Custom Post Type
- Filtering the_content, but still need to display the unfiltered content inside filter
- Why the_excerpt() function returns excerpt on the Home page and trimmed content in sidebar?
- Change Custom Post Type singular_name through function/filter
- Modify a plugin function output from another plugin
- Custom Taxonomy Filter Issues
- Why is the output of a call to the_excerpt different when the call seems to be identical?
- Catch and display error on save_post action
- How can I add in post’s the text “No content”
- Excerpt length: get first paragraph
- filter the_content, custom post type, and wp_query
- show most viewed posts of last days by link?
- Filter search posts by post meta?
- Modifying search results based on post_type
- Remove filter and view options from custom post type edit screen
- Is possible register two archive pages for single custom post type?
- Add Content Column to Custom Post Type backend
- Display custom post front end filter by ACF equals current user
- conditional filter
- custom filtering admin columns
- Ajax Post Filter | Split Taxonomy Into minPrice & maxPrice
- Custom Permalink For Custom Post Type – Working Fine But Broken For Pagination
- Query filter by value in meta_value array
- Best way to fix bad count on All | Mine | Published
- Creating post template for a Custom Post Type
- WP Admin Dropdown List Filter for custom (ACF) field on custom post type(s)
- Is there any filter to add a custom attribute to the tag in admin panel?
- Display category filters for custom post type when category is shared by multiple post types
- Store a value in global scope after init hook is fired
- Default excerpt for parent of a custom post type
- Filter in Custom post type to find the parent post
- Dynamic page for nav items used as filters
- Create Post Types from a XML url (Real Estate website)
- Filter posts by their related field’s custom field
- Post Click Redirect to Custom URL instead of Single Post Page
- How can I add image sizes for a specific custom post type?
- Mandatory excerpt for custom post type
- How can we display full post on home page rather than excerpt
- Adding specific custom fields (images) to post excerpt
- Add content to wordpress edit.php page
- How to use multiple orderby conditions on query search results? (orderby one post type, relevance)
- add_rewrite_tag broke permalinks that doesn’t use that specific tag
- pricefilter without WooCommerce
- Output all terms slugs for a loop filter
- Insert custom taxonomy into category query
- filter rest api post by a acf filed
- Group Custom Posts Types in a Relation field of ACF
- Help Adding filter to Add Media button for custom post type
- Shortcode in excerpt
- Apply pre_get_posts to specific custom post type in the admin area
- how it’s possible to show from a post of a custom post type the taxonomy/terms?
- Keep custom read more link on the same line as excerpt text
- Keep br tags from stripping
- Add filter button to custom post type in admin area