If this tutorial is not what you were looking for, you still have any questions, suggestions or concerns - feel free to let us know. Please help us to serve you better!

Your Name

Your Email

Your Message (required)

captcha

Featured templates

CherryFramework 3.x. How to add custom portfolio options to portfolio post

CherryFramework 3.x. How to add a Portfolio post custom option field

This tutorial is going to show you how to add custom portfolio options to your Portfolio post in CherryFramework 3.x. based templates.

CherryFramework_3.x._How_to_add_a_Portfolio_post_custom_option_field-1

Note that customization suggested below is being performed on the CherryFramework theme and it is going to be lost if you update the framework. Make sure you use the latest version of the framework and also make a backup of your website before updating the framework.

In order to add a Portfolio post custom option field, you need to perform the following:

  1. Obtain access to your server files. You can either use FTP or a control panel file manager if you have one.

  2. Open up the wp-content/themes/CherryFramework/includes/theme-portfoliometa.php file. We’re going to add a Portfolio post custom option field Price as an example.

  3. In the theme-portfoliometa.php find the following piece of code:

    array(
       'name' => "info",
       'desc' => "info_desc",
       'id' => $prefix . 'portfolio_info',
       'type' => 'text',
       'std' => ''
    ),
    			

    Replace info strings with price:

    array(
       'name' => "price",
       'desc' => "price_desc",
       'id' => $prefix . 'portfolio_price',
       'type' => 'text',
       'std' => ''
    ),
    			

    CherryFramework_3.x._How_to_add_a_Portfolio_post_custom_option_field-2

  4. Save the changes and upload the theme-portfoliometa.php file to the server.

  5. Open up the wp-content/themes/CherryFramework/loop/loop-single-portfolio.php file. Locate the following line of code:

    $portfolioInfo   = get_post_meta($post->ID, 'tz_portfolio_info', true);
    			

    Duplicate it and replace info with price:

    $portfolioPrice   = get_post_meta($post->ID, 'tz_portfolio_price', true);
    			

    CherryFramework_3.x._How_to_add_a_Portfolio_post_custom_option_field-3

  6. Find the following code in the loop-single-portfolio.php file, duplicate it and replace info with price:

    if (!empty($portfolioInfo)) {
    	echo '<li>';
    	echo '<strong class="portfolio-meta-key">' . theme_locals("info").":". '</strong>';
    	echo '<span>' . $portfolioInfo . '</span><br />';
    	echo '</li>';
    }
    			
    if (!empty($portfolioPrice)) {
    	echo '<li>';
    	echo '<strong class="portfolio-meta-key">' . theme_locals("price").":". '</strong>';
    	echo '<span>' . $portfolioPrice . '</span><br />';
    	echo '</li>';
    }
    			

    CherryFramework_3.x._How_to_add_a_Portfolio_post_custom_option_field-4

  7. In the same file, update the following if condition:

    if (!empty($portfolioClient) || !empty($portfolioDate) || !empty($portfolioInfo) || !empty($portfolioURL)) {
    	echo '</ul>';
    }
    			

    By including the portfolioPrice variable.

    if (!empty($portfolioClient) || !empty($portfolioDate) || !empty($portfolioInfo) || !empty($portfolioURL) || !empty($portfolioPrice)) {
    	echo '</ul>';
    }
    			

    CherryFramework_3.x._How_to_add_a_Portfolio_post_custom_option_field-5

  8. Save the changes and upload the loop-single-portfolio.php file to the server.

  9. Open up the wp-content/themes/CherryFramework/includes/locals.php file. Scroll down to the last localization argument (approximately line 1106, ‘nofollow_desc’).

  10. Insert the following code after the last localization argument:

    'price' => __('Price', $domain),
    'price_desc' => __('Price of the portfolio item.', $domain),
    			

    Here you can specify the description for the new portfolio option field:

    CherryFramework_3.x._How_to_add_a_Portfolio_post_custom_option_field-6

  11. Save the changes and upload the locals.php file to the server.

  12. Now you can use the new field to add extra meta information to your portfolio posts:

    CherryFramework_3.x._How_to_add_a_Portfolio_post_custom_option_field-7

    CherryFramework_3.x._How_to_add_a_Portfolio_post_custom_option_field-8

Feel free to check the detailed video tutorial below:

CherryFramework 3.x. How to add a Portfolio post custom option field