aside from a few syntax errors in there with your printf
s, 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
- Help Needed: Issue with Change Permalink on DirectoryPress Listing Pages
- Custom Dynamic Tag in Elementor not showing image
- How to make Http Request to a php file present in plugin directory of wordpress
- Create a custom page template inside my wordpress plugin
- Retrieving plugin options value saved through setting
- Best way to hook a custom url?
- How to cancel WordPress’ action/filter when using OOP with anonymous callback
- Read text defined under __()
- How to change commenter links to /user/user_id?
- Display content from custom post type if match to main post category
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- Execute a plugin only on post pages
- What is the best way to mimic a search query within a plugin
- Next and/or previous post content
- Serialize data for wp options
- Remove rewrite rules generated by plugin during deactivation
- How to trigger $_GET request within admin plugin page?
- HTML in WooCommerce settings
- Plugin Paths Issue
- Building an email signup form. Where should the information be saved in the DB?
- Can WordPress Plugin Directory Cache Delay the Upload of Images?
- Why my Plugin keeps deactivating automatically?
- Determine Registered Admin Menus
- How to generate video out of images via WordPress plugin
- Saving Custom Post types and fields to a custom table
- How can I add an options page for my class based plugin?
- How to Create a Custom Plugin Permalink
- Sending WP posts to external API
- How to write a plugin to add users to a mail list
- What function can I use consistently to escape possible HTML for editing and display?
- WordPress plugin for activating other plugins
- Any Short code Availble for Get Post List With Thumbnail Plugin?
- plugin development: problem with functions
- Custom Field Template seriously messed up in WP 3.1.1
- How can I get WordPress to save comments in markdown format?
- First WordPress Plugin – Stat Issues
- Getting a List of Categories for Use in a Plugin?
- Changing labels of status filters for post grid
- Can we use a webservice with WordPress?
- Where to call add_shortcode function in WordPress Plugin Boilerplate?
- How do I add a custom sub menu menu under Woo-commerce marketing?
- WooCommerce get_price returning wrong price when used via ajax
- How to ‘clone’ a wp plugin to make small changes
- How to load plugin after page is loaded – pagespeed issues
- Open Post Thumbnail in New Child Theme File in WordPress
- How to pull code snippet from functionality plugin?
- How to use get_theme_mod in gutenberg editor wordpress?
- MITM risk of not sanitizing?
- Get IDs of Images from Gallery Block in InnerBlocks of a Custom Gutenberg Block
- How to keep users unique id stored in session in addition to IP in WordPress plugin?
- Loco Translate: Custom Post and Custom Taxonomy Labels not translated in wp-admin menu
- Where should I save an API key of my user when installing my plugin?
- How to make a customize role and view a specific plugins base on that role?
- Reusable functions and tools (Framework)
- Is Wrapping intval() Around esc_attr() Redundant for Escaping Input?
- Programatically download a plugin
- WordPress plugin – Error “Plugin generate 2890 characters of unexpected output when activated”
- React JSX in WordPress Plugin Development
- My plugin wants to update another plugin
- Redirecting to home page after login as custom role WordPress
- Add keywords meta to index.php page
- Custom form action to handle data inside a plugin
- Where (or when) should I register a new taxonomy?
- Woocommerce plugin for minimum order and add-to-card-step
- Self deactivate plugins after an action occurs
- How to get current post user id
- UnInstallation of a Plugin from a developers perspective – The correct and clean method
- Issue with adding count to “subsubsub” aka quick links on custom_post_type
- Pulling data from custom plugin settings using PHP shortcode and Javascript
- Carbon Fields use in custom plugin class
- How to slice an array using posts_per_page? [closed]