To add a custom field, we need to edit 3 files, these are described below
to edit page displays
/newsite/wp-content/themes/CherryFramework/loop/loop-single-portfolio.php
to edit portfolio options
/newsite/wp-content/themes/CherryFramework/includes/theme-portfoliometa.php
to edit custom locals
/newsite/wp-content/themes/CherryFramework/includes/locals.php
--
An example of a custom field added are between those lines below:
/* custom field */
/* end of custom field */
Notice that if the custom field is not populated, it doesn't show on the front page
I'm going to add the snippets that need to be edited here:
$portfolioMotor = get_post_meta($post->ID, 'tz_portfolio_motor', true);
$portfolioCustom = get_post_meta($post->ID, 'tz_portfolio_custom', true);
if (/* custom field*/ !empty($portfolioCustom) || !empty($portfolioMotor) || /* end of custom field */ !empty($portfolioClient) || !empty($portfolioDate) || !empty($portfolioInfo) || !empty($portfolioURL)) {
echo '<ul class="portfolio-meta-list">';
}
if (!empty($portfolioCustom)) {
echo '<li>';
echo '<strong class="portfolio-meta-key">' . theme_locals("custom").":". '</strong>';
echo '<span>' . $portfolioCustom . '</span><br />';
echo '</li>';
}
if (!empty($portfolioMotor)) {
echo '<li>';
echo '<strong class="portfolio-meta-key">' . theme_locals("motor").":". '</strong>';
echo '<span>' . $portfolioMotor . '</span><br />';
echo '</li>';
}
if (/* custom field */ !empty($portfolioCustom) || !empty($portfolioMotor) || /* end of custom field */ !empty($portfolioClient) || !empty($portfolioDate) || !empty($portfolioInfo) || !empty($portfolioURL)) {
echo '</ul>';
}?>
array(
'name' => 'custom',
'desc' => "custom_desc",
'id' => $prefix . 'portfolio_custom',
'type' => 'text',
'std' => ''
),
array(
'name' => 'motor',
'desc' => "motor_desc",
'id' => $prefix . 'portfolio_motor',
'type' => 'text',
'std' => ''
)
'motor_desc' => __('Input the motor', $domain),
'motor' => __('Motor', $domain),
'custom_desc' => __('Input the custom field, or whatever text you want here', $domain),
'custom' => __('Custom', $domain), /* this needs to be the name of the custom field */
and that's all, I'm going to add this text to the video