I want to load content from another table into wp_posts and then show it as a normal page. What solution do you recommend.
If that’s your goal, then use shortcodes!
For example:
// PHP code
add_shortcode( 'footag', 'wpdocs_footag_func' );
function wpdocs_footag_func( $atts ) {
return "foo = ".$atts['foo'];
}
Then in your content:
[footag foo=”bar”]
This prints foo = bar
on the frontend
The [footag]
will get replaced by what your shortcode function returns, and it’ll happen when the page is generated. You can pass attributes to it too
Read more about add_shortcode
and check the examples at the official docs here:
https://developer.wordpress.org/reference/functions/add_shortcode/
Related Posts:
- Create page when plugin is activated
- Replace existing pages with new pages, keep menu links
- Distributing and packaging plugins
- Copyright messages for a particular set of pages
- View Private Published Page with URL Code (no login required)
- Advanced WordPress plugin activation detection
- What is the best way to make a custom page from a plugin?
- Elementor: How to design Dropdown Select Box Navigation page like Chegg
- Give custom page template a custom post ID
- Adding LOAD MORE on a page
- Best approach to serve static content within a regular page
- Restrict my pages from public
- Problems with installing and deleting plugins
- Edit Yoast SEO breadcrumbs output [closed]
- What’s the best way to implement AJAX in WordPress?
- How to Create a Custom Panel and Fields in Post Page [Plugin]
- Translating long texts with html formatting
- How would I go about creating a user ranked post popularity page?
- Anonymous Postings
- Do widget options need to be escaped widget()?
- Is there any W3C compatible Share & Follow plugin?
- Does any one have Idea to get these functionalities with the plugin wp-multi-network
- How to check if tables in WordPress still exists after activations
- How to block plugin activations with no known user or coming from unknown IP address range?
- Disable woocommerce cookies and delete cart data automatically
- How to delete page by deactivating plugin
- className not populating in custom block
- WordPress web pages keep getting deleted (moved into the trash) by themselves
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- (FES EDD) New vendor submission page is blank
- Overide plugin files from child theme (/inc/ ) folder
- wp_generate_attachment_metadata is creating an empty array
- custom payment gateway in woocommerce failed to connect to remote api server
- Display encrypted content on my website
- Post category with counts been display like a menu
- Post custom Data value in The Events Calendar plugin [closed]
- Send reply with pre-prepared answers
- 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?
- Save custom attributes of product in woocommerce
- Calling an attribute from a plugin shortcode
- Best place for short bio,image and button [closed]
- WordPress plugin/theme or other wayout to create portable pages?
- Use of Templates in a Plugin
- Force file download on plugin activation
- Why can’t I access my Intranet LDAPS with NADI?
- php page not found for plugin options menu
- External Domain on WordPress Multisite
- In the archive widget, how do I sort in between two years?
- Customization API for plugin development
- Fromcraft Plugin On click submit button [closed]
- Changing page URL and connect newsletter to MailChip
- creating a custom shop page display on archive woocommerce
- Setup page on first login on multisite
- WordPress user account activation
- polylang + category/tag custom language link
- Anspress Customization: How to show logged in user votes on a single answer?
- Custom wordpress Theme and Plugin repository
- Automatic Updates Individual Plugins Not Working
- How do I make a child theme I made POST through a 3rd party plugin?
- WordPress page and plugin list using sql query
- Create page from plugin, but have it completely hidden
- How create Group Blogs based on user created Groups
- Multiple instance of data in plugin custom database table on plugin activation
- Why this function not working for install database on plugin activation
- How to redirect users to their profile after they successfully edit their profile
- Custom table naming/access convention for multisite: $table_prefix vs base_prefix or other?
- Add ALT attribute to Pin It Button image to pass HTML5 validation
- date/time-picker and file upload (image) fields for custom fields (e.g. with more fields)
- Getting Theme element into plugins page editor in wp admin
- WordPress as web application base
- How to add subcategories to the blogroll?
- Customize The Events Calendar to Include an Option to Expand for More Events Listings
- URL rewrite of independent plugin?
- Plugin for users to create their own ads like Google Adsence
- GeoMashup plugin: how to customize cluster markers / icons? [closed]
- How do I write an inventory list plugin that creates dynamic details pages?
- Can I allow certain people to add/edit pages within a parent?
- How do I apply style to each category of a list?
- Proper way to replace the_content only for pages created by custom plugin
- Add category selection to custom post type (plugin)
- Add menu page issues (permissions & position)
- register_activation_hook in oop approach
- Redirect to another page using contact form 7? [closed]
- changing posts layout in ultimate member profile plugin
- How to create multiple database tables on plugin activation?
- Display Custom Field Value on Admin Page Column
- “No Add Button” for me to customize my WordPress with themes and pluggins
- Would Gutenberg be considered a PlugIn?
- I need help locating a URL that is on my site map, but that I can’t find in my WordPress dashboard
- Translation plugin to translate another plugins
- Login Customizer doesn’t change the background of the register form
- Show author on every sub-page
- Inserting custom PHP script on homepage
- Run function on plugin activation before plugin is loaded
- Creating Featured Content Boxes
- Integrating WP E-commerce plugin into custom theme
- Best practice for including plugin output in a template without using shortcode?
- Custom post types – remove default post supports through empty array?
- Basic gallery plugin suggestion [closed]