function fg_save_perm_metadata($post_id, $post) { $post_type = folio_get_current_post_type(); if ($post_type === 'portfolio' || $post_type === 'post') { // Noncename if (isset($_POST['fg_perm_noncedata'])) { if (!wp_verify_nonce($_POST['fg_perm_noncedata'], plugin_basename(__FILE__))) { return $post->ID; } } // Verification of User if (!current_user_can('edit_post', $post->ID)) { return $post->ID; } // OK, we're authenticated: we need to find and save the data if (isset($_POST['fg_perm_metadata'])) { $events_meta['fg_perm_metadata'] = $_POST['fg_perm_metadata']; // Add values of $events_meta as custom fields foreach ($events_meta as $key => $value) { if ($post->post_type == 'revision') { return; } $value = implode(',', (array) $value); if (get_post_meta($post->ID, $key, FALSE)) { update_post_meta($post->ID, $key, $value); } else { add_post_meta($post->ID, $key, $value); } if (!$value) { delete_post_meta($post->ID, $key); } } } } }
function kraftive_setup() { define('CSS_PATH', get_template_directory_uri() . '/assets/css/'); define('JS_PATH', get_template_directory_uri() . '/assets/js/'); define('IMAGES_PATH', get_template_directory_uri() . '/assets/images/'); load_theme_textdomain('kraftives', get_template_directory() . '/languages'); // Add post formats (http://codex.wordpress.org/Post_Formats) if (folio_get_current_post_type() === 'portfolio') { add_theme_support('post-formats', array('image', 'gallery', 'video')); } else { // for default blog posts add_theme_support('post-formats', array('image', 'gallery', 'video', 'audio', 'quote')); } add_theme_support('title-tag'); // Tell the TinyMCE editor to use a custom stylesheet add_editor_style('custom/custom_fields/assets/css/editor-style.css'); $defaults = array('default-image' => '', 'random-default' => false, 'width' => 0, 'height' => 0, 'flex-height' => false, 'flex-width' => false, 'default-text-color' => '', 'header-text' => true, 'uploads' => true, 'wp-head-callback' => '', 'admin-head-callback' => '', 'admin-preview-callback' => ''); add_theme_support('custom-header', $defaults); }
$team_meta->Finish(); /*-------------------------------------------------------------------------------- | KraftiveComments: Portfolio Post Type / Metaboxes | --------------------------------------------------------------------------------*/ /* Headings Section */ $config = array('id' => 'portfolio_header_custom_fields', 'title' => __('Portfolio Header Headings', 'kraftives'), 'pages' => array('portfolio'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true); $portfolio = new Metabox_Extended($config); /* Heading 1 */ $portfolio->addTextarea('heading_1', array('name' => __('Heading 1', 'kraftives'), 'desc' => __('This will be the 1st heading', 'kraftives'))); /* Heading 2 */ $portfolio->addTextarea('heading_2', array('name' => __('Heading 2', 'kraftives'), 'desc' => __('This will be the 2nd heading', 'kraftives'))); $portfolio->Finish(); /* Portfolio Details Section */ $config = array('id' => 'portfolio_custom_fields', 'title' => __('Portfolio Details', 'kraftives'), 'pages' => array('portfolio'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true); $portfolio_details = new Metabox_Extended($config); $portfolio_details->addText('portfolio_client', array('name' => __('Client', 'kraftives'), 'desc' => __('Insert Client title of this project', 'kraftives'))); $portfolio_details->addText('portfolio_url', array('name' => __('Live URL', 'kraftives'), 'desc' => __('Insert live URL of this project', 'kraftives'))); $portfolio_details->addText('portfolio_url_title', array('name' => __('Live URL title', 'kraftives'), 'desc' => __('Insert live URL title to display as link, if it is empty then url will be used as a fallback.', 'kraftives'))); $portfolio_details->addText('portfolio_tagline', array('name' => __('Tag line', 'kraftives'), 'desc' => __('This will only display in portfolio listing module in builder', 'kraftives'))); $portfolio_details->addText('portfolio_launch_project_link', array('name' => __('Launch Project Link', 'kraftives'), 'desc' => __('Insert external URL for project', 'kraftives'))); $portfolio_details->Finish(); /*-------------------------------------------------------------------------------- | KraftiveComments: Layout Options for Page / Post Type / Metaboxes | --------------------------------------------------------------------------------*/ $config = array('id' => 'post_custom_fields', 'title' => __('Layout Options', 'kraftives'), 'pages' => array('page', 'post'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true); $layout_options = new Metabox_Extended($config); $layout_options->addSwitch('sidebar_active', array('name' => __('Sidebar', 'kraftives'), 'desc' => __('Turn it on to active sidebar.', 'kraftives'), 'std' => folio_get_current_post_type() === 'page' ? 'false' : 'true')); $layout_options->addRadioImage('page_layout_option', array('sidebar_right' => 'Sidebar Right', 'sidebar_left' => 'Sidebar Left', 'sidebar_2right' => 'Sidebar-2 - Right', 'sidebar_2left' => 'Sidebar-2 - Left', 'sidebar_both' => 'Sidebar Both'), array('name' => __('Select layout Option.', 'kraftives'), 'std' => array('sidebar_left'), 'desc' => __('Select the layout option', 'kraftives'))); $layout_options->Finish(); } //end is_admin()
<?php global $content_blog_width; ?> <!-- page_nav starts --> <div class="col-sm-12"> <div class="page_nav <?php if (folio_get_current_post_type() === 'portfolio') { echo "project_page_nav span_center"; } ?> "> <?php next_post_link('%link', '<i class="fa fa-angle-right"></i>', false); ?> <?php previous_post_link('%link', '<i class="fa fa-angle-left"></i>', false); ?> </div> </div> <!-- page_nav ends -->