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?
- Does the number of downloads displayed for a plug-in in the WordPress.org plug-in directory include automatic updates?
- Why do I get this “plugin does not have a valid header” error?
- Edit plugin without hooks in functions.php
- Which method is best to enqueue scripts
- WordPress Capabilities: edit_user vs edit_users
- Making plugin unique to not conflict with plugins with the same name
- Is dynamic forms/entries possible in Widget?
- Is there a WordPress Plugin that allows voting “does this coupon work” on specific links like Retailmenot
- How to get posts by content?
- Built in admin ajax hooks?
- Force plugin to fail activation
- How to integrate plugin in WordPress theme
- Dynamic CSS Vs Inline Issues in Code any Way around in a WordPress Themes?
- Is license need for free wordpress plugin
- Getting a List of Categories for Use in a Plugin?
- UnWanted Custom field added in the wp page edit area
- Building plugin with changeable custom post type values…advice needed
- How to get all of the activate_plugin action parameters?
- Display update notification messages like ‘What’s New’
- CRUD and Frontend show from a custom table without shortcode
- How can I make 2 plugins that include different versions of a framework to both use the latest version?
- Add Plugin options as subpage to Theme options page
- Image upload and download from front-end
- What can be reason for no plugin-strings available under stable section on translate.wordpress.org?
- correct way to include a library(and its dependent libraries) in wordpress development
- Issue Tracker from pre exsisting table [closed]
- WP_Terms_List_Table Quick Edit not working
- Git Hosting for WordPress SVN Plugin Repository [closed]
- Problem with the Loop – want to limit the access to three free articles
- Is there a directory my plugin can write files to that cannot be viewed via the browser/url?
- How to exclude certain files from the plugin editor?
- Stop Plugin from Getting Styles from Other Plugin
- WordPress Plugin manipulate have_posts()
- WordPress REST API Plugin Development – Add Custom Endpoint
- Hook into the rendering of a WordPress Template
- Adding class to last list item? Not WP generated
- Default taxonomy template in plugin, override in theme
- How to add support for caching plugins for my own plugin?
- Save user total active time after login in wordpress [closed]
- WordPress gtag.js with User ID tracking
- WordPress Site is Broken, Cannot see wp-admin page [closed]
- wp_loaded with static Singleton
- How to remove a CPT Menu from the Root Admin only
- Get post_id on clicking a link in WordPress
- WordPress.org: How to add a plugin for certain countries?
- Calling a save function from a “submit” button
- Wp Debug Enabled True Notices and Warning
- Select Form Element Not Saving from Plugin Options
- My widget won’t update its values when save is clicked
- Can we give Pending as a Role to wp_insert_user?
- Custom page from wp admin area
- Unexpected add action function in WP plugin
- Avada Live is broken on WP
- Is there any way to sync Facebook Comments and with comments on WordPress website?
- Offering a freemium plugin (a free version + paid version)
- Block content rendering on the top just below body tag
- WordPress “template_include” Filter Not Working
- Limit Google Ads to particular blog posts
- WordPress not displaying information on post sent from custom admin form
- Communicating to plugins from webserver
- Buddypress Member list not showing admin and mods
- Shortcode in a blog post, footer and related products stop working
- Editing a built plugin: How to activate it only on a single post page
- Linking Plugin Files to WP
- How do i use postMash to order posts in a custom loop?
- Couldn’t find a documentation for a filter API in plugin development
- Getting Post Permalink Outside of Loop Not Working
- Trying to display posts but getting the pages as output
- Plugin version number after code rewrite [closed]
- How to escape html code?
- Create Custom Coupon Type
- Is it possible to create post in wordpress using postman?