You need to return the filtered content, try like this:
add_filter('the_content', 'emd_content');
function emd_content( $content ) {
if ( is_page('Member Directory') ) {
include dirname( __FILE__ ) . '/content-members.php';
}
elseif ( is_page('Contact Members') ) {
include dirname( __FILE__ ) . '/content-member-contact-form.php';
}
else {
return $content;
}
}
But the better way is to use custom page template for those pages.
Related Posts:
- Add hook after content without formatting
- Can I add content before post content without using the_content filter
- WordPress Add advertising ads befor and after content with periority [closed]
- Pass PHP variable to javascript
- Where is the best place to use add_filter
- Creating a WordPress admin page without a menu for a plugin
- Edit plugin without hooks in functions.php
- Create page when plugin is activated
- Using add_filter inside another class
- How can I show drafts in wp_dropdown_pages list?
- WordPress adding tags into plugin content
- How to list the Hooks and order of execution in current loading page? [duplicate]
- Pass A Value From Outside To A Plugin Variable
- Failed to invoke other hook from the init hook
- How can I filter blog name?
- why does the add_action(‘the_content’) overwrite my page
- Custom preview_post_link not working for draft post
- Add Fields with Sub-Fields to WP Job Manager
- Determine plugin name from within plugin_action_links filter
- merging an array to an existing array using add_filter
- How Can A Plugin Hook Itself To the End of Every Excerpt?
- add_filter the_content in functions.php not working
- How can plugins have their own pages?
- Create a custom page template inside my wordpress plugin
- Do action only on certain front end pages?
- Creating a plugin to sanitize comment and the url field before display only
- How to find the origin of a file upload from within wp_handle_upload?
- White page by using filter template_include
- How to check current user before all actions and filters?
- Create a navbar filter that filters by a custom field
- Passing an array from shortcode-function to filter-function
- Get Time Taken By Each Action Hook in WordPress
- php page not found for plugin options menu
- qTranslate remove default directory from link
- Output content to the_content before a plugin does
- How to change the name of the “edit my profile” link in the WordPress admin backend
- add_filter doesn’t work
- Redirect to another page using contact form 7? [closed]
- Check if variable is set in filter
- Check filter defined or not?
- Add a function call after content automatically?
- what is the point of telling add_filter how many parameters you want passed to the function?
- How to add filter for wordpress plugin?
- How to use add_action for multiple instances of the same class
- Filters on the_content with plugins, pages and shortcode
- How to append new form elements in “Add New” form of Users in WordPress admin panel?
- Pass PHP variable to javascript
- Want to create custom design of progress indicator in wpforms
- Using OR Condition with facetwp facets
- Randomize post (and page) IDs on generation
- WordPress Frontend Page using Plugin
- 500 Internal server error wp_handle_upload_prefilter
- Nested Actions and Filters
- WordPress the_content Filter and GET Parameter
- Remove action added in plugin class from theme
- Using multi-dimensional array with filter
- Get content and send to 3rd party
- Choose default template for a page with code
- How Can the_post Be Hooked Like the_content and the_excerpt?
- Update Plugin Without Overwriting Custom Settings
- trying to create simple plugin to filter categories from all authors
- shortcode which is introduced into entry the blog, and appears in side bar
- How do i get all author posts on custom post type list
- Retrive images from the_content()
- How to tell which Plugin is displaying?
- Redirect url in plugin to somewhere else?
- Which action/filter can i use for a Member Plugin [closed]
- Unable to pass arguments from plugin form to filter hook using ajax, the data is transferring via ajax but unable to pass as arguments in filter hooks
- Meta box not displaying on the plugin page
- How to access the page without registering in wordpress
- Read page- or post-content across different builder-plugins
- How can we extent core/group or cover block?
- Why Does The `auto_update_plugin` Hook Disable Management?
- Is there a script to collect all hooks and filters provided by a plugin?
- WordPress Ajax request “Failed to load resource: the server responded with a status of 400 ()”
- How to update changes to multiple sites at the same time
- How often should I execute add_filter and function declaration in Code Snippets?
- wp_handle_upload – specified file failed upload test
- how to make wordpress remember my choice
- Why am I getting an error when requiring a file in my plugin?
- Running a function using Crown WordPress on one day a week, for example, Mondays of every week
- How to make a Template page to show the information of different things Shop and Product page?
- wordpress admin-ajax bad request 400
- public custom posts not showing in my wordpress plugin
- Allow manage_options capability for specific user only for specific plugin?
- How can I use the zip of my plugin in another website?
- show_admin_bar filter not called inside plugin class
- WordPress 6.3 headers already sent error
- WordPress theme is not displaying the correct home page in the Pages section
- Remove wpseo filter from polylang plugin
- Unable to Edit or Add Photo Gallery Under Portfolio in WordPress 6.2.5
- Plugin question, How to insert a colon in a value box
- Need a Category List for the category slug
- What are the implications of having main plugin file name different to plugin slug?
- How to secure custom endpoint for rest api in WordPress
- Cron Job not working
- How to prevent WP All Export from wrapping XML nodes in CDATA? [closed]
- How to Display News in a Timeline with Headline, Category, and Time?
- Show only those pages that are created by the specific logged in user in WordPress
- Remove and strip html tag values