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
- How can I edit post data before it is saved?
- 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?
- Checking if an attribute exists in a shortcode
- When can you get current page ID and initialize hooks right after?
- Show Similar Post Titles ( Similar to Stack Exchange )
- How do I unlock a post programmatically?
- 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)
- Which functions in theme or plugin load first
- WordPress Plugin as ‘Library’ From Abstract Application?
- How to show custom message once on plugin activation?
- Shortcode display outside the div
- Add CSS animation as Preloader to WordPress
- How to list the Hooks and order of execution in current loading page? [duplicate]
- 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
- Updating post meta for custom post types
- 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
- REST-API: extend media-endpoint
- 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?
- template_redirect not being called when using ajax
- add action wp_head not working
- What are the benefit in adding hook in the init() hook?
- add_action in functions.php, do_action in plugin?
- Is there a way to alter the order in which the plugins appear in the page?
- Custom plugins/Manipulated plugins: Always a terrible idea to inherit these types of WP sites that discourage updates? [closed]
- add action for displaying posts using a shortcode
- ‘wp_login’ action hook not working with wp-login.php file
- How to use get_theme_mod in gutenberg editor wordpress?
- Get IDs of Images from Gallery Block in InnerBlocks of a Custom Gutenberg Block
- WordPress plugin – Error “Plugin generate 2890 characters of unexpected output when activated”
- My plugin wants to update another plugin
- 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
- Edit Yoast SEO breadcrumbs output [closed]
- When to load auto-login code?
- How would I go about creating a user ranked post popularity page?
- 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?
- Custom plugin init action causing general slowness
- Customization API for plugin development
- Fromcraft Plugin On click submit button [closed]
- How to redirect users to their profile after they successfully edit their profile
- Inject HTML meta tag inside wordpress tag using add_shortcode
- echo plugin results on pages
- How to use custom footer template in a site-plugin?
- Creating Nested custom fields
- Confusing problem with displaying message recipient metadata
- 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
- Plugin Hook: Get posts
- 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?
- Get page type to display content
- How to generate a responsive output from plugin?
- WordPress Code Access to Restricted Content without Registration
- How to add image for custom taxonomy
- What can I do to customize a widget provided with this plugin? from where have I to start?
- WordPress Customise
- Why haven’t I see plugins using get_file_data to handle retrieving plugin version?
- How can I properly sanitize the update_option in WordPress?
- Create Custom Coupon Type
- 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?
- add_action() not working for admin
- I have created a custom plugin. After activation it creating page but i am not getting how to add another php file at page content?
- show_admin_bar filter not called inside plugin class
- Need to add custom cart item data
- wp_head filter not executed inside custom class
- Redirrect after facebook successful login to wooommerce cart page url
- How can I keep a WordPress dropdown menu open when navigating to a child page?
- how to add custome text in each products side in checkout page after pincode validation [closed]