Hooks are going to be your best friend here.
You can filter post content by using the the_content
filter for example:
add_filter('the_content', 'wse_174099_append_to_content');
function wse_174099_append_to_content( $content ) {
//get your data
$custom_items = get_option( 'option_name' );
$content .= wpautop( $custom_items );
//always return when using a filter
return $content;
}
You can hook into the footer of the site by hooking into the wp_footer action:
add_action('wp_footer', 'your_function');
function your_function() {
$custom_items = get_option( 'option_name' );
echo $custom_items;
}
You could also look at the get_header and get_footer actions. The only issue is that you can’t control where the theme calls the header and footer files in – it may be a bad spot to output your code.
Hope this helps!
Related Posts:
- How can I limit functionality in one version of a plugin?
- How wordpress plugin hooks works? [duplicate]
- How to structure a plugin
- is_plugin_active function doesn’t exist
- Custom pages with plugin
- Where is the best place to use add_filter
- WordPress Plugin Development In MVC Architecture, How?
- Is it a good idea to edit an already existing plugin to add more functionality?
- When can you get current page ID and initialize hooks right after?
- Create page when plugin is activated
- Using the ‘draft_to_publish’ hook (post status transition)
- Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
- WordPress Plugin as ‘Library’ From Abstract Application?
- How to show custom message once on plugin activation?
- Shortcode display outside the div
- Good tools for locating hooks in a wordpress page/admin interface/blog post?
- How to load a new template page according to a particular URL?
- WordPress network: set themes and plugins for new blog
- Failed to invoke other hook from the init hook
- Is it possible to add an action to the currently running action?
- Created Widget Not Showing up on Admin Panel
- Action on post publish
- How to add inline css/js inside a shortcode
- How to call bind function in wordpress actions or hooks
- How to prevent action in ajax request, when in admin side?
- add action wp_head not working
- What are the benefit in adding hook in the init() hook?
- Custom plugins/Manipulated plugins: Always a terrible idea to inherit these types of WP sites that discourage updates? [closed]
- ‘wp_login’ action hook not working with wp-login.php file
- How to use get_theme_mod in gutenberg editor wordpress?
- JS Support Ticket – Auto create WP account
- Any hook for pre-plugin-update -either bulk or single plugin update
- Input with spaces in Shortcode attributes overwritten by defaults
- wordpress plugin is not activating from widget
- When to load auto-login code?
- How to get all of the activate_plugin action parameters?
- Disable woocommerce cookies and delete cart data automatically
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- How to check current user before all actions and filters?
- custom payment gateway in woocommerce failed to connect to remote api server
- Get Time Taken By Each Action Hook in WordPress
- Best way to maintain and update 3rd-party WP plugin when developer is unresponsive?
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- Customization API for plugin development
- Fromcraft Plugin On click submit button [closed]
- Redirect to another page using contact form 7? [closed]
- Add action to fire when a published post is updated
- How to pass variables to a function argument using add_action [duplicate]
- Custom post types – remove default post supports through empty array?
- a weird attribute on every html tag
- How can I run a custom shortcode function on a live site and only run if the viewer is a specific machine?
- Submit Form data to another page via Ajax (WordPress Way)
- Does using `add_action( ‘init’…` cause performance issues?
- Plugin function inside custom plugin
- Hook for page Request?
- Minimize and Uglify WordPress Plugin Files
- Advanced WordPress plugin activation detection
- How to create a plugin that includes all the other plugins?
- Why is it important to check for isset and is_array before checking in_array in this example?
- Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
- Calling a save function from a “submit” button
- Action on WordPress Install
- Custom CSS not being added by plugin
- How to use add_action for multiple instances of the same class
- Delete data from custom table when deleting a post
- Integrating Custom Database with WordPress
- Custom Module, Extending WP with a Plugin?
- I cannot include a file in my plugin settings page
- Custom Post Type, Custom Columns List
- Edit post image attributes on fly?
- How to keep plugin (media-sync) running even the tab is closed?
- Check if theme supports sidebar
- How to access a wordpress plugin page or add posts without doing it from the WordPress dashboard?
- Custom Plugin: How to Include Install Buttons of other 3rd Party Plugins?
- Ultimate Members Default Post Layout problem
- Why do actions with class and public method don’t fire __construct()
- Move plugin pages from dashboard to front-end
- Installation failed, trying to install ANY plugin
- Load my Inline js footer area
- Get post content inside plugin class method
- Remove action added in plugin class from theme
- Woocommerce list variations that are added already to cart in Single Product
- Echo custom admin field into a is_single()
- How to use custom footer template in a site-plugin?
- Why the output of an image gallery plugin is not displayed into a page of my custom theme?
- Custom pages with plugin
- Am I using an action hook correctly?
- Update Plugin Without Overwriting Custom Settings
- Display_rows() and column_cb() strange behaviour
- How can I pass value to function in add_menu_page?
- Multiselect value in wp_query
- show Visual form builder in the front end
- Is it possible to cancel a post status transition?
- How to generate a responsive output from plugin?
- WordPress Code Access to Restricted Content without Registration
- What can I do to customize a widget provided with this plugin? from where have I to start?
- WordPress Customise
- Take Elementor For Email FIeld Check if user is registered. IF not registered then register on woocommerece
- WordPress isn’t sending welcome email with the password reset
- How to make a Template page to show the information of different things Shop and Product page?