aside from a few syntax errors in there with your printfs, the crux of the problem is things like this:
$title = get_post_meta( $post->ID, 'title', true );
won’t work in your included file because there is no $post in this scope, You have to globalize $post before you can use it:
global $post;
$title = get_post_meta( $post->ID, 'title', true );
Related Posts:
- How can I save repeatable fields with one value inside an array?
- Plugin not saving values when placed in a folder within /wp-content/plugins
- how do i remove posts from a WP_Query so the pagination is right?
- Creating a custom post type, adding custom meta fields, preventing all future editability of posts of this type
- Fetch Children of Grouped Products Inside WooCommerce Product Loop
- Redirect to another page using contact form 7? [closed]
- Bulk update wordpress posts
- How to Resize the Custom Post Images?
- Amazon.com intergration with WordPress?
- Loop in elementor custom widget not working
- Price comparison table based on Custom Post Type?
- Show related posts based of current ACF field name in a single page post (a loop within loop)
- Remember the Meta Value With Radio Buttons
- Plugin is creating posts twice
- Custom Fields for Page Edits
- Table of contents (TOC) plugin is not showing header tag
- i need to make custom cron_schedule with custom interval time as a parameter into a custom payment gateway plugin wordpress
- Create multiple posts when a custom post is created
- How to get post that has non zero or greater than zero meta value
- How can I call functions from a custom plugin?
- Creating Nested custom fields
- Problem with conditional woocommerce custom checkout field
- Creating a user ‘add custom field’ section
- Multiselect value in wp_query
- Synch Custom Post Types (and Custom Fields, Cats, etc.) Between WordPress Sites
- WordPress Meta Query: Relation is not working correctly
- Integrating WordPress Content into a jQuery Slider
- How to dispaly post informations (such as titles) in an admin plugin menu page?
- Need to add custom cart item data
- What is difference between get_bloginfo(‘url’) and get_site_url()?
- Custom media upload content for inserting custom post shortcode
- Page Templates from plugin not working after upgrading WP to 4.7 or upper version
- How to add option box in “Edit Post” plugin API?
- Avoiding plugin name collisions with WP updater
- Using standard backend elements in Plugin
- Plugin development: how to create a form and get custom data?
- Security error WP 4.0 + WP phpBB Bridge [closed]
- How to make my plugin theme-independent?
- Execute a function using ajax
- Updating post meta for custom post types
- Custom Shipping method not showing in checkout
- REST-API: extend media-endpoint
- How can I create a simple interface for my WP plugin?
- Can’t get custom posts of taxonomy to show
- Where to put my global functions?
- Where does WordPress register default scripts like jQuery?
- Adding Attachment Display Settings in custom media frame
- Is it possible to enqueue CSS files from plugin before theme’s CSS files?
- Determine Registered Admin Menus
- Implement Autocomplete for a custom field on WordPress Plugin Frontend
- Help With MySQL to WPDB Query Conversion
- code is working properly in Core PHP but writing coding in WordPress
- Custom plugin init action causing general slowness
- Remove .htaccess portion upon plugin deactivation?
- How to add a dvi tag to a shortcode then change a generated text using jQuery
- ACF in wordpress
- First plugin, problem with get_pages
- Order posts by meta key ( Using ACF )
- How to add fields in the WordPress editor?
- Translation issue with global variables
- Is there a better way of handling AJAX requests in WordPress?
- what is the point of telling add_filter how many parameters you want passed to the function?
- How to add category and subcategory in WordPress custom code?
- Can’t create tables with my plugin
- using wp_cache in plugin
- How to create repeater field manually, without plugin (ACF Pro)?
- Should I use the action in the plugin’s main file?
- Dotenv file in custom plugin
- Check if theme supports sidebar
- Problem with MEMCACHE and Redis with wp_options
- Change plugin descriptions
- Getting the same post on my related post
- I want to schedule email (date, time is in database->table) wp_schedule_event() not working
- How to remove WordPress Default Comment? not Facebook
- How to use Datatable with Ajax when creating plugin on WordPress?
- Use Case: Multiple Shipping Methods per Order
- Showing how many times is plugin activated or deactivated
- plugin operation launch every time i click on page
- WP options plugin setting not saving the selected checkboxes
- Run query on specific admin options page and send results to select field in another function
- how to add custom css at top above all css file for specific url
- Form tries to download a file on submit
- Coming soon pages with rest of site in maintenance mode
- insert multiple entries in database using a loop issue
- Plugin Works, but Widget Doesn’t
- Merge custom plugins in one folder
- Execute certain function on GET request
- A plugin for software reviews site like this one?
- How to include a custom thumbnail with my WordPress plugin?
- How to create a nameplate extension? [closed]
- ACF Plugin WP with list-group – Vimeo [closed]
- Suitable hook when creating, updating and deleting posts programmatically
- How can I gather forums posted by visitors from different sites in one place? [duplicate]
- How to make content as required in custom post type?
- How to create a “Most Popular” & “Latest” TAB in WordPress
- is_user_logged_in() undefined at shutdown in plugin context
- What are Seeds? [closed]
- Shortcode cannot parse attributes within double quotes. ” is becoming ” breaking my shortcode
- I am trying to add form using ACF plugin and acf_form() function, but my user fields dont show up properly
- Gutenberg Blocks and Elementor