Try use this (functions.php) :
function product_title($id) {
$custom='CustomField'; // Your custom field here
return get_post_meta($id, $custom, true);
}
and call func in your template (in loop and etc…):
<?php $p_title=product_title(get_the_ID()); ?>
<h3>Product : <?php echo ($P_title); ?> </h3>
Related Posts:
- Manually set global $post vars with an ID, in order to use template tags
- Place content inside the Post Loop
- Best collection of code for your 'functions.php' file [closed]
- Between functions.php (theme), widgets, and plugins, which is loaded first?
- Where do I put the code snippets I found here or somewhere else on the web?
- Disable plugin / plugin action via theme
- How do I call wp_get_current_user() in a plugin when plugins are loaded before pluggable.php?
- How do I replace a function, declared inside a plugin’s class, in functions.php?
- How to not allow users to create new tags, but allow to them to use existing ones
- How to export comments in WordPress?
- How to include a plugin’s php file to another plugin functions file [duplicate]
- How can I call a function from one plugin within another plugin?
- Shared functionality in plugins and themes
- Is it possible to define a template for a custom post type within a plugin independent of the active theme?
- Gutenberg disallow certain custom blocks but keep all core blocks?
- Remote upload file to server B
- Publish author posts only with editor approval?
- Replacing Icons in the Dashboard
- Ways to have multiple front-page.php templates that can be swapped out?
- How to remove WPML Generator Meta Tag by theme’s functions.php (override plugin function)? [closed]
- Output before and after the loop
- Plugin update error message
- Limit access to posts/pages by user roles
- Using functions from a plugin in your theme
- Prevent publishing the post before setting a featured image?
- Keep one user logged for a year?
- Remove Google Fonts Which Are (Probably) Added By Plugins
- Customizing subject in comment notification e-mails
- if plugin is active? check if plugin is enabled or not?
- Common functionality between my own plugins
- WP showing “warning: call_user_func_array()”, What to do?
- Need to create a Theme demo site that features multiple themes
- Adding a text domain to every __(), _e() and __n() gettext call without a plan to create own translations
- Autogenerate wordpress shortcodes using array?
- How to Loop Plugin Option Field Set?
- Can we completely remove the WordPress Sitemaps (WordPress 5.5)?
- Declare a function before plugin does on the theme functions.php file
- How to handel multiple checkbox field in the admin settings page with Settings API
- Why does including a file in theme’s functions.php not work?
- wp_insert_user – how to send verification email before logging in
- How to override a theme function (within a class) using a plugin
- Editor access to plugin settings
- WooCommerce create new product and add to cart on form submit
- Seeking clarification on page request life-cycle
- Generate Advanced Custom Fields box in custom admin menu page
- How to assign user a role if none is present when logging in
- Is the WordPress HTTPS Plugin Still Safe To Use? [closed]
- Saving Plugin settings to the database
- Set a User as Author of all ‘New Posts’ posted
- Shortcode display outside the div
- Post source link plugin – small modification
- Adding New Role
- Change destination author link
- How to turn off email you receive when registered?
- Removing user contact methods works from functions.php but not from a plugin
- Execute a function using ajax
- Shortcode under a Shortcode Multiple times Possible?
- Custom Widget outputs the input but doesn’t save anything inside the textarea
- How can I let users to access plugin functions based on roles?
- How do you auto-activate plugins from child themes
- How to call a plugin function in footer.php
- Add Top-Level Menu that opens URL
- Template for custom post type shows all posts instead of just one
- How to load plugin before the wordpress jquery?
- How to remove action from plugin?
- Fastest way to loop through all posts?
- While Using Static Pages, How Can I Get /blog into the URL of Each Post?
- Use functionality of 2 wordpress plugins
- What is the function to get plugin base url in multisite?
- Code in theme functions.php faster than with a plugin?
- How does WordPress ensure plugins run at the same time and how does it solve a plugin’s dependency on another one?
- Fatal error: Class not found in
- Disabling post images for not logged in users
- What’s the point of using WordPress’s built in admin-ajax.php?
- wordpress custom login successful redirect hook
- How can i change an image’s author?
- post expire after x days
- Converting a simple plugin to be placed inside of functions.php
- WordPress ajax call for not logged in users, doesn’t work
- Extend Elementor Archive Posts widget with a custom skin in order to show multiple badges
- HELP: Integrating WP with raw PHP code once published button is hit
- Over write plugin templates
- How to find out what blocks are added by a plugin
- Display All Non-Used Plugins
- Override plugin functions in functions.php
- Override the core function locate_template
- How to redirect Old Post URL to new Post and keep Old post Comments?
- Can wp_script_is used in pluginA check if a script is being enqueued/registered from pluginB?
- Using has_filter with a class based plugin to check whether the plugin is active or not
- Modifying Footnote Plugin for Descriptive Title Attributes
- I would like to use create a function in my custom plugin to tell WP to use a different header
- New Plugin: Post update pushes a copy as a revision
- Set WordPress Featured Image For All Post Slugs Matching Image File Name in Specified Directory
- Showing Co-Authors on post page
- Can’t get custom posts of taxonomy to show
- How to Replace Words with Hypertext Link But Ignore Previously Existed Links?
- bulk change of image setting “link to” to “link to: image url “
- Placement of Code in Plugin for hooking `save_post`
- jQuery Plugin to use WordPress functions in AJAX request
- Using plugin functionality in external php script not working