It’s a common mistake about the difference of WordPress’ Actions and Filters.
- Action is when you want something to happens besides the default.
- Filter is when you want something to happens instead the default.
Knowing that, when you use an action, your output will be inserted in that action content. But when you use a filter, your output will replace that filter content.
In the filter the_content you are replacing all the content from a post with your plugin content. So, the right way to fix it would be appending your content to the output, like $content .= "<div>...</div>";
Related Posts:
- Best way to overide plugin CSS?
- Ways to create a paid wordpress plugin?
- OpenID for WordPress 3.x? [duplicate]
- Edit plugin without hooks in functions.php
- How to register_sidebar() without messing up the order?
- Is dynamic forms/entries possible in Widget?
- Template for different category on woocommerce product [closed]
- WordPress plugin DB upgrade
- Trigger a custom wordpress plugin with a linux cron
- Have Plugin Handle Specific URLs
- Allow a userclass to save a page as a draft – but not publish w/o admin approval
- Layout shop page: resize images and columns
- Custom options page checkbox will not save, despite working with text
- Security checking in meta_box save is reluctant?
- What causes an Unexpected HTTP Error within install plugins?
- How do I write into a file (css)
- Cache WP remote_get HTTP Response using Transients
- What is an arbitrary URL?
- Is there a way to share your Facebook Page’s stream on a WordPress page or post?
- How to add equivalent of php include to one page (as plugin?)
- Allow users of my plugin to define their own shortcode rather than use mine?
- CRUD and Frontend show from a custom table without shortcode
- Child Pages Short Code plug-in and hover capabilities?
- Timed Exam test for candidates [closed]
- There has been a critical error on your website. Please check your site admin email inbox for instructions.Learn more about debugging in WordPress [closed]
- How to call WordPress function other files
- Submit page limited in time to upload image
- Plugin alternative to Normalize.CSS? [closed]
- media page returnig to 404 in rtmedia [closed]
- Hide certain widgets from specific user roles in admin
- Delay JavaScript files from loading
- How to display checked posts on another page over AJAX? (like comparasion style)
- Custom widget doesn’t save values from dropdown box
- Register Script in Plugin Widget
- jQuery Click event is not fired at all
- Getting error “Warning: mysql_query(): Can’t connect to local MySQL server through socket ‘FILEPATH/cccatalog-plugin.php on line 1656”
- Widget for specific category
- Plugins successfully uploaded via FTP but they are not on my site
- Webservice credential storage [duplicate]
- Fetch CSS of posts
- Development workflow for WordPress using git – issues with plugins and bloginfo(‘wpurl’)
- Fancybox plugin: triggering on href attribute
- Is there a Image Gallery which will load all my posted Images like twitter’s image grid?
- Gravatar alternative for WordPress
- How to use wordpress plugin functions on my “home” page?
- Uninstalling IntenseDebate
- Single Domain/Multiple Domain installation restrictions allowed for plugins?
- Plugin to display weekly schedule that can be edited via admin panel
- WooComerce Deposit: set specific shipping method and quantity based deposit amount
- Replace the_content with ACF Flexible Content via function
- Menu not closing after clicking – WordPress – Elementor
- Translations not appended even strings are edited
- Is there any way to sync Facebook Comments and with comments on WordPress website?
- Is there a way to auto generate poster image for videos
- wp_create_user not working on plugin file
- WordPress Shortcodes – Return $Variable
- Woocommerce convert simple products to variations
- How much PHP and MySQL or MariaDB knowledge should I know to start writing WordPress themes and plug-ins and whatever else a beginner can edit?
- On wp-admin menu, the slider revolution option leads to a 404 error, page not found
- Reverse count page view and show on other page
- Block content rendering on the top just below body tag
- How to bookmark pages that have dynamic URLs?
- Will downloading a page builder plugin delete my existing data?
- How to submit custom form data using ajax to HubSpot form?
- Copying content from my other websites
- WordPress “template_include” Filter Not Working
- Caching of combined CSS and JS fails because of losing MIME types through combining by PHP
- Register setting on plugin activation
- Add a filter to a method in the parent theme
- WordPress not displaying information on post sent from custom admin form
- How can I automatically send an email with an excel file containing submissions for a form rather than an email per submission?
- Run only on plug-in activation instead of wp_head
- How can I easily add code under the tag without using hooks? [duplicate]
- Problem with Duplicate Meta / tag description in Webmaster Tool [duplicate]
- Add “selected” class to custom taxonomy dropdown search
- Include plugin form in the home page
- page creator to leave comments ONLY
- Differentiate attachment pages in search results
- Is saving multiple options or saving multiple items in one option better?
- How to get the parameters on page and avoid 404?
- Working on fixing wp-front-end-editor, encountering undefined index
- How to add plugin activity in the menus?
- Photos do not show on SEO platform built into a wordpress plugin
- Building a simple “settings” plugin to change textstrings on the home page
- Share Button Like SuperUser
- Couldn’t find a documentation for a filter API in plugin development
- phpBB 3 to bbPress
- What plugin(s) are best for this User registration task? [closed]
- Using Postmash plugin in WordPress 3.3.1
- Trying to display posts but getting the pages as output
- Element works, but not on wordpress site [duplicate]
- AdBlock blocks my non-advertising sidebar images [closed]
- Plugins not showing on dashboard?
- register_activation_hook not working
- Predefine Product Variations for specific custom product type [closed]
- Hook automatic_updates_complete to autoupdate plugin
- Cannot register a block in my Twig-based theme using Timber for WP
- How to use `$order->get_discount_total()`, avoiding defoult WC decimal rounding?
- How to install and activate a plugin using an external PHP script?
- Can plugin authors make db tables remain upon deactivation, but be removed upon plugin deletion?