1st commit

This commit is contained in:
2024-04-06 11:45:36 +02:00
commit 62a52850bc
228 changed files with 37418 additions and 0 deletions

40
extends/footer-area.php Normal file
View File

@@ -0,0 +1,40 @@
<?php if ( get_option('toppic_theme_content_style') === 'kk-full' && ( kk_social_profiles() !== '' || has_nav_menu( 'footer-menu' ) )) { ?>
<div class="kk-content-footer">
<div class="kk-inner-footer">
<!-- start footer navigation -->
<?php wp_nav_menu(
array(
'container' => 'nav',
'container_class' => 'footer-nav',
'theme_location' => 'footer-menu',
'depth' => 1,
'fallback_cb' => false ,
'walker'=>''
)
)?>
<!-- end footer navigation -->
<?php if ( !in_array( get_option('toppic_theme_menu_style'), array( 'kk-menu-default' ) ) ) { ?>
<!-- start social -->
<?php echo kk_social_profiles(); ?>
<!-- end social -->
<?php } ?>
</div>
</div>
<?php } ?>
<?php if ( get_option('toppic_theme_content_style') === 'kk-boxed' && get_option('toppic_theme_menu_style') === 'kk-menu-classic' && ( kk_social_profiles() !== '' || get_option('toppic_theme_copyrights') !== '' )) { ?>
<div class="kk-content-footer">
<div class="kk-inner-footer">
<!-- start copyright -->
<div class="copyright">
<?php echo stripslashes(get_option('toppic_theme_copyrights')); ?>
</div>
<!-- end copyright -->
<!-- start social -->
<?php echo kk_social_profiles(); ?>
<!-- end social -->
</div>
</div>
<?php } ?>

58
extends/menu/boxed.php Normal file
View File

@@ -0,0 +1,58 @@
<?php
$postid = kk_postid();
?>
<!-- start icons wrapper -->
<div class="kk-icons-wrapper">
<!-- start album icon -->
<div class="kk-info-trigger">
<i class="kk-icon-info"></i>
</div>
<!-- end album icon -->
<!-- start thumbs icon -->
<div class="kk-thumbs-trigger">
<i class="kk-icon-th-large-outline"></i>
</div>
<!-- end thumbs icon -->
</div>
<!-- end icons wrapper -->
<aside id="menu-wrapper" class="menu-wrapper clearfix">
<!-- start logo -->
<div class="logo">
<?php kktfwp_the_custom_logo(); ?>
</div>
<!-- end logo -->
<!-- start mobile menu trigger -->
<div class="kk-mobile-trigger">
<span></span>
</div>
<!-- end mobile menu trigger -->
<!-- start navigation -->
<nav class="main-nav">
<?php wp_nav_menu(array('container'=>'','theme_location'=>'main-menu','depth'=>0,'fallback_cb'=>false ,'walker'=>''))?>
</nav>
<!-- end navigation -->
<!-- start footer -->
<footer class="footer">
<!-- start social -->
<?php echo kk_social_profiles (); ?>
<!-- end social -->
<!-- start copyright -->
<div class="copyright">
<?php echo stripslashes(get_option('toppic_theme_copyrights')); ?>
</div>
<!-- end copyright -->
</footer>
<!-- end footer -->
</aside>

54
extends/menu/classic.php Normal file
View File

@@ -0,0 +1,54 @@
<?php
$postid = kk_postid();
?>
<header id="menu-wrapper" class="menu-wrapper">
<div class="kk-menu-container">
<!-- start logo -->
<div class="logo">
<?php kktfwp_the_custom_logo(); ?>
</div>
<!-- end logo -->
<!-- start mobile menu trigger -->
<div class="kk-mobile-trigger">
<span></span>
</div>
<!-- end mobile menu trigger -->
<div class="menu-icons">
<!-- start navigation -->
<nav class="main-nav">
<?php wp_nav_menu(array('container'=>'','theme_location'=>'main-menu','depth'=>0,'fallback_cb'=>false ,'walker'=>''))?>
</nav>
<!-- end navigation -->
<div class="some-buttons">
<!-- start album icon -->
<div class="kk-info-trigger">
<i class="kk-icon-info"></i>
</div>
<!-- end album icon -->
<!-- start thumbs icon -->
<div class="kk-thumbs-trigger">
<i class="kk-icon-th-large-outline"></i>
</div>
<!-- end thumbs icon -->
<!-- start search icon -->
<?php if ( get_option('toppic_theme_search_button') == 'true' ) { ?>
<div class="kk-search search-trigger">
<i class="kk-icon-search"></i>
</div>
<?php } ?>
<!-- end search icon -->
</div>
</div>
</div>
</header>

View File

@@ -0,0 +1,87 @@
<?php
$postid = kk_postid();
?>
<header class="creative-top-wrapper">
<!-- start logo -->
<div class="logo">
<?php kktfwp_the_custom_logo(); ?>
</div>
<!-- end logo -->
<div class="some-buttons">
<!-- start album icon -->
<div class="kk-info-trigger">
<i class="kk-icon-info"></i>
</div>
<!-- end album icon -->
<!-- start thumbs icon -->
<div class="kk-thumbs-trigger">
<i class="kk-icon-th-large-outline"></i>
</div>
<!-- end thumbs icon -->
<!-- start search icon -->
<?php if ( get_option('toppic_theme_search_button') == 'true' ) { ?>
<div class="kk-search search-trigger">
<i class="kk-icon-search"></i>
</div>
<?php } ?>
<!-- end search icon -->
<!-- start menu icon -->
<div class="kk-menu-trigger">
<span></span>
</div>
<!-- end menu icon -->
</div>
</header>
<div class="creative-top-wrapper-bg"></div>
<!-- start search form -->
<?php if ( get_option('toppic_theme_search_button') == 'true' ) { ?>
<div class="search-fs-form">
<!-- start search close icon -->
<div class="kk-search-close">
<span></span>
</div>
<!-- end search close icon -->
<?php get_search_form( ); ?>
</div>
<?php } ?>
<!-- end search form -->
<div class="kk-homepage-o"></div>
<aside id="menu-wrapper" class="menu-wrapper clearfix">
<!-- start navigation -->
<nav class="main-nav">
<?php wp_nav_menu(array('container'=>'','theme_location'=>'main-menu','depth'=>0,'menu_class'=>'menu dl-menu dl-menuopen','fallback_cb'=>false ,'walker'=>''))?>
</nav>
<!-- end navigation -->
<!-- start footer -->
<footer class="footer">
<!-- start social -->
<?php echo kk_social_profiles (); ?>
<!-- end social -->
<!-- start copyright -->
<div class="copyright">
<?php echo stripslashes(get_option('toppic_theme_copyrights')); ?>
</div>
<!-- end copyright -->
</footer>
<!-- end footer -->
</aside>

109
extends/menu/default.php Normal file
View File

@@ -0,0 +1,109 @@
<?php
$postid = kk_postid();
?>
<?php if ( get_option('toppic_theme_menu_style') == 'kk-menu-default-hidden' ) { ?>
<div class="icons-wrapper">
<div class="kk-menu-trigger">
<span></span>
</div>
<!-- start search icon -->
<?php if ( get_option('toppic_theme_search_button') == 'true' ) { ?>
<div class="kk-search search-trigger">
<i class="kk-icon-search"></i>
</div>
<?php } ?>
<!-- end search icon -->
<!-- start album icon -->
<div class="kk-info-trigger">
<i class="kk-icon-info"></i>
</div>
<!-- end album icon -->
<!-- start thumbs icon -->
<div class="kk-thumbs-trigger">
<i class="kk-icon-th-large-outline"></i>
</div>
<!-- end thumbs icon -->
</div>
<!-- start search form -->
<?php if ( get_option('toppic_theme_search_button') == 'true' ) { ?>
<div class="search-fs-form">
<!-- start search close icon -->
<div class="kk-search-close">
<span></span>
</div>
<!-- end search close icon -->
<?php get_search_form( ); ?>
</div>
<?php } ?>
<!-- end search form -->
<div class="menu-helper"></div>
<?php } else if (get_option('toppic_theme_menu_style') == 'kk-menu-default') { ?>
<!-- start icons wrapper -->
<div class="kk-icons-wrapper">
<!-- start album icon -->
<div class="kk-info-trigger">
<i class="kk-icon-info"></i>
</div>
<!-- end album icon -->
<!-- start thumbs icon -->
<div class="kk-thumbs-trigger">
<i class="kk-icon-th-large-outline"></i>
</div>
<!-- end thumbs icon -->
</div>
<!-- end icons wrapper -->
<?php } ?>
<aside id="menu-wrapper" class="menu-wrapper">
<!-- start logo -->
<div class="logo">
<?php kktfwp_the_custom_logo(); ?>
</div>
<!-- end logo -->
<!-- start mobile menu trigger -->
<div class="kk-mobile-trigger">
<span></span>
</div>
<!-- end mobile menu trigger -->
<!-- start navigation -->
<nav class="main-nav">
<?php wp_nav_menu(array('container'=>'','theme_location'=>'main-menu','depth'=>0,'fallback_cb'=>false ,'walker'=>''))?>
</nav>
<!-- end navigation -->
<!-- start footer -->
<footer class="footer">
<!-- start social -->
<?php echo kk_social_profiles (); ?>
<!-- end social -->
<!-- start copyright -->
<div class="copyright">
<?php echo stripslashes(get_option('toppic_theme_copyrights')); ?>
</div>
<!-- end copyright -->
</footer>
<!-- end footer -->
</aside>

View File

@@ -0,0 +1,88 @@
<?php
$postid = kk_postid();
?>
<header class="fullscreen-top">
<div class="fullscreen-top-wrapper">
<!-- start logo -->
<div class="logo">
<?php kktfwp_the_custom_logo(); ?>
</div>
<!-- end logo -->
<div class="some-buttons">
<!-- start album icon -->
<div class="kk-info-trigger">
<i class="kk-icon-info"></i>
</div>
<!-- end album icon -->
<!-- start thumbs icon -->
<div class="kk-thumbs-trigger">
<i class="kk-icon-th-large-outline"></i>
</div>
<!-- end thumbs icon -->
<!-- start search icon -->
<?php if ( get_option('toppic_theme_search_button') == 'true' ) { ?>
<div class="kk-search search-trigger">
<i class="kk-icon-search"></i>
</div>
<?php } ?>
<!-- end search icon -->
<!-- start menu icon -->
<div class="kk-menu-trigger">
<span></span>
</div>
<!-- end menu icon -->
</div>
</div>
<div id="menu-wrapper" class="menu-wrapper clearfix">
<!-- start navigation -->
<nav class="main-nav">
<?php wp_nav_menu(array('container'=>'','theme_location'=>'main-menu','depth'=>0,'menu_class'=>'menu dl-menu dl-menuopen','fallback_cb'=>false ,'walker'=>''))?>
</nav>
<!-- end navigation -->
<!-- start footer -->
<div class="footer">
<!-- start social -->
<?php echo kk_social_profiles (); ?>
<!-- end social -->
<!-- start copyright -->
<div class="copyright">
<?php echo stripslashes(get_option('toppic_theme_copyrights')); ?>
</div>
<!-- end copyright -->
</div>
<!-- end footer -->
</div>
<!-- start search form -->
<?php if ( get_option('toppic_theme_search_button') == 'true' ) { ?>
<div class="search-fs-form">
<!-- start search close icon -->
<div class="kk-search-close">
<span></span>
</div>
<!-- end search close icon -->
<?php get_search_form( ); ?>
</div>
<?php } ?>
<!-- end search form -->
</header>

View File

@@ -0,0 +1,594 @@
<?php
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_filter( 'rwmb_meta_boxes', 'kktfwp_meta_boxes');
function kktfwp_meta_boxes( $meta_boxes )
{
/**
* Prefix of meta keys (optional)
* Use underscore (_) at the beginning to make keys hidden
* Alt.: You also can make prefix empty to disable it
*/
// Better has an underscore as last sign
$prefix = 'kk_';
$bgMeta = array(
array(
'name' => esc_html__( 'Background type', 'toppic' ),
'id' => "_custom_bg_type_value",
'type' => 'select',
'tab' => 'background',
'options' => array (
'Default' => esc_html__( 'Default', 'toppic' ),
'Custom Slideshow' => esc_html__( 'Custom Slideshow', 'toppic' ),
'Video' => esc_html__( 'Video', 'toppic' ),
'Image' => esc_html__( 'Image', 'toppic' ),
),
'std' => 'default',
'hidden' => array( 'page_template', 'template-homepage-grid.php' )
),
array(
'name' => esc_html__( 'Images/Slides', 'toppic' ),
'id' => "{$prefix}homegrid",
'type' => 'image_advanced',
'tab' => 'background',
'max_file_uploads' => 0,
'visible' => array('_custom_bg_type_value', 'Custom Slideshow'),
),
array(
'name' => esc_html__( 'Background video', 'toppic' ),
'desc' => esc_html__( 'Enter an URL to the background video file for this page. Supports: HTML5 video (mp4), YouTube. If you prefer to use YouTube, simply add an URL to the YouTube page where your video is.', 'toppic' ),
'id' => "_bg_video_value",
'tab' => 'background',
'type' => 'input',
'visible' => array('_custom_bg_type_value', 'Video'),
),
array(
'name' => esc_html__( 'Fallback background image', 'toppic' ),
'desc' => esc_html__( 'This image will be displayed if mobile device doesn\'t support background video. Strongly recommend to use this option', 'toppic' ),
'id' => "_bg_image_fallback_value",
'tab' => 'background',
'type' => 'file_input',
'visible' => array('_custom_bg_type_value', 'Video' ),
),
array(
'name' => esc_html__( 'Background image', 'toppic' ),
'id' => "_bg_image_value",
'tab' => 'background',
'type' => 'file_input',
'visible' => array('_custom_bg_type_value', 'Image' ),
),
array(
'name' => esc_html__( 'Background-repeat property', 'toppic' ),
'id' => '_custom_bg_repeat_value',
'type' => 'select',
'tab' => 'background',
'options' => array (
'repeat' => esc_html__( 'Repeat', 'toppic' ),
'no-repeat' => esc_html__( 'No repeat', 'toppic' ),
'repeat-x' => esc_html__( 'Repeat X', 'toppic' ),
'repeat-y' => esc_html__( 'Repeat Y', 'toppic' ),
),
'std' => 'no-repeat',
'visible' => array('_custom_bg_type_value', 'Image' ),
),
array(
'name' => esc_html__( 'Background-position property', 'toppic' ),
'id' => '_custom_bg_position_value',
'type' => 'select',
'tab' => 'background',
'options' => array (
'Top Left' => esc_html__( 'Top Left', 'toppic' ),
'Top Center' => esc_html__( 'Top Center', 'toppic' ),
'Top Right' => esc_html__( 'Top Right', 'toppic' ),
'Center' => esc_html__( 'Center', 'toppic' ),
),
'std' => 'Top Left',
'visible' => array('_custom_bg_type_value', 'Image' ),
),
array(
'name' => esc_html__( 'Background size', 'toppic' ),
'id' => '_custom_bg_size_value',
'type' => 'select',
'tab' => 'background',
'options' => array (
'Full' => esc_html__( 'Full', 'toppic' ),
'Original' => esc_html__( 'Original', 'toppic' ),
),
'std' => 'Original',
'visible' => array('_custom_bg_type_value', 'Image' ),
)
);
$pageMeta = array(
array(
'name' => esc_html__( 'Image proportions', 'toppic' ),
'id' => "_kk_homepage_layout_value",
'type' => 'select',
'tab' => 'page',
'options' => array(
'Random' => esc_html__( 'Original', 'toppic' ),
'Square' => esc_html__( 'Square', 'toppic' ),
'Landscape' => esc_html__( 'Landscape', 'toppic' ),
'Portrait' => esc_html__( 'Portrait', 'toppic' ),
),
'std' => 'Random',
'hidden' => array( 'page_template', '!=', 'template-homepage-grid.php' )
),
array(
'name' => esc_html__( 'Images', 'toppic' ),
'id' => "{$prefix}grid",
'type' => 'image_advanced',
'tab' => 'page',
'max_file_uploads' => 0,
'hidden' => array( 'page_template', '!=', 'template-homepage-grid.php' )
),
array(
'name' => esc_html__( 'Album columns', 'toppic' ),
'id' => "_album_layout_value",
'type' => 'select',
'tab' => 'page',
'options' => array(
'3-column' => esc_html__( '3 columns', 'toppic' ),
'3-column (wide)' => esc_html__( '3 columns (wide)', 'toppic' ),
'4-column' => esc_html__( '4 columns', 'toppic' ),
'4-column (wide)' => esc_html__( '4 columns (wide)', 'toppic' ),
),
'std' => '3-column',
'hidden' => array( 'page_template', '!=', 'template-gallery.php' )
),
array(
'name' => esc_html__( 'Portfolio columns', 'toppic' ),
'id' => "_portfolio_layout_value",
'type' => 'select',
'tab' => 'page',
'options' => array(
'3-column' => esc_html__( '3 columns', 'toppic' ),
'3-column (wide)' => esc_html__( '3 columns (wide)', 'toppic' ),
'4-column' => esc_html__( '4 columns', 'toppic' ),
'4-column (wide)' => esc_html__( '4 columns (wide)', 'toppic' ),
),
'std' => '3-column',
'hidden' => array( 'page_template', '!=', 'template-portfolio.php' )
),
array(
'name' => esc_html__( 'Categories to display in this portfolio', 'toppic' ),
'id' => "{$prefix}filter-portfolio",
'type' => 'taxonomy',
'tab' => 'page',
'taxonomy' => 'portfolio-type',
'field_type' => 'checkbox_list',
'visible' => array( 'page_template', 'template-portfolio.php' )
),
array(
'name' => esc_html__( 'Categories to display in this gallery', 'toppic' ),
'id' => "{$prefix}filter",
'type' => 'taxonomy',
'tab' => 'page',
'taxonomy' => 'gallery-type',
'field_type' => 'checkbox_list',
'hidden' => array( 'page_template', '!=', 'template-gallery.php' )
),
);
$parallax = array(
array(
'name' => esc_html__( 'Title type', 'toppic' ),
'id' => "{$prefix}title_type",
'type' => 'button_group',
'tab' => 'page',
'options' => array(
'default' => esc_html__( 'Default', 'toppic' ),
'parallax' => esc_html__( 'Parallax', 'toppic' ),
'disabled' => esc_html__( 'No title', 'toppic' ),
),
'std' => 'default',
'hidden' => array( 'page_template', 'in', array( 'template-homepage-slider.php', 'template-homepage-grid.php' ) )
),
array(
'name' => esc_html__( 'Parallax height', 'toppic' ),
'id' => "{$prefix}title_size",
'type' => 'button_group',
'tab' => 'page',
'options' => array(
'standard' => esc_html__( 'Standard', 'toppic' ),
'full' => esc_html__( 'Full', 'toppic' ),
),
'std' => 'standard',
'visible' => array('kk_title_type', 'parallax' ),
),
array(
'name' => esc_html__( 'Parallax background', 'toppic' ),
'desc' => esc_html__( 'Recommended image size: min width - 1920px', 'toppic' ),
'id' => "{$prefix}title_bg",
'type' => 'image_advanced',
'tab' => 'page',
'max_file_uploads' => 1,
'visible' => array('kk_title_type', 'parallax' ),
),
);
if ( get_option( 'toppic_theme_menu_style' ) !== 'kk-menu-left-boxed' && get_option( 'toppic_theme_content_style' ) === 'kk-full' ) {
$pageMeta = array_merge(
$pageMeta, $parallax
);
}
// PAGE META
$meta_boxes[] = array(
'title' => esc_html__( 'Page Attributes', 'toppic' ),
'post_types' => array ( 'page' ),
'id' => 'kktfwp-page-settings',
'context' => 'normal',
'priority' => 'high',
'tabs' => array(
'page' => array(
'label' => esc_html__( 'Page', 'toppic' ),
'icon' => 'dashicons-admin-page', // Dashicon
),
'background' => array(
'label' => esc_html__( 'Background', 'toppic' ),
'icon' => 'dashicons-welcome-view-site', // Dashicon
),
),
// Tab style: 'default', 'box' or 'left'. Optional
'tab_style' => 'left',
'fields' => array_merge(
$bgMeta, $pageMeta
)
);
// PRODUCT META
$meta_boxes[] = array(
'title' => esc_html__( 'Page Attributes', 'toppic' ),
'post_types' => array ( 'product' ),
'id' => 'kktfwp-page-settings',
'context' => 'normal',
'priority' => 'high',
'tabs' => array(
'background' => array(
'label' => esc_html__( 'Background', 'toppic' ),
'icon' => 'dashicons-welcome-view-site', // Dashicon
),
),
// Tab style: 'default', 'box' or 'left'. Optional
'tab_style' => 'left',
'fields' => array_merge(
$bgMeta
)
);
// PORTFOLIO META
$meta_boxes[] = array(
'title' => esc_html__( 'Page Attributes', 'toppic' ),
'post_types' => array ( 'portfolio' ),
'id' => 'kktfwp-page-settings',
'context' => 'normal',
'priority' => 'high',
'tabs' => array(
'page' => array(
'label' => esc_html__( 'Project', 'toppic' ),
'icon' => 'dashicons-format-image', // Dashicon
),
'background' => array(
'label' => esc_html__( 'Background', 'toppic' ),
'icon' => 'dashicons-welcome-view-site', // Dashicon
),
),
// Tab style: 'default', 'box' or 'left'. Optional
'tab_style' => 'left',
'fields' => array_merge(
$bgMeta, $parallax,
array(
array(
'name' => esc_html__( 'Sidebar', 'toppic' ),
'id' => "{$prefix}project_layout",
'type' => 'button_group',
'tab' => 'page',
'options' => array(
'sidebar_off' => esc_html__( 'Disable', 'toppic' ),
'sidebar_on' => esc_html__( 'Enable', 'toppic' ),
),
'std' => 'sidebar_off'
),
array(
'name' => esc_html__( 'Project Type', 'toppic' ),
'id' => "{$prefix}project_type",
'type' => 'button_group',
'tab' => 'page',
'options' => array(
'image' => esc_html__( 'Image(s)', 'toppic' ),
'slideshow' => esc_html__( 'Slider', 'toppic' ),
'video' => esc_html__( 'Video', 'toppic' ),
),
'std' => 'image'
),
array(
'name' => esc_html__( 'Slider Autostart', 'toppic' ),
'id' => "{$prefix}slider_auto",
'class' => 'slider-auto-wrapper',
'type' => 'button_group',
'tab' => 'page',
'options' => array(
'yes' => esc_html__( 'Yes', 'toppic' ),
'no' => esc_html__( 'No', 'toppic' ),
),
'std' => 'no',
'visible' => array('kk_project_type', 'slideshow' ),
),
array(
'id' => "{$prefix}sliderDelay",
'class' => 'slider-auto-wrapper',
'type' => 'number',
'tab' => 'page',
'name' => esc_html__( 'Delay between transitions (ms)', 'toppic' ),
'std' => '3000',
'min' => '1',
'step' => '1',
'visible' => array('kk_project_type', 'slideshow' ),
),
array(
'name' => esc_html__( 'Upload project images', 'toppic' ),
'id' => "{$prefix}projimg",
'class' => 'projimg_wrapper',
'type' => 'image_advanced',
'tab' => 'page',
'max_file_uploads' => 0,
'hidden' => array('kk_project_type', 'video' ),
),
array(
'name' => esc_html__( 'Paste your embedded video code', 'toppic' ),
'id' => "{$prefix}projvid",
'class' => 'projvid_wrapper',
'type' => 'textarea',
'tab' => 'page',
'clone' => false,
'visible' => array('kk_project_type', 'video' ),
),
)
)
);
// GALLERY META
$meta_boxes[] = array(
'title' => esc_html__( 'Page Attributes', 'toppic' ),
'post_types' => array ( 'gallery' ),
'id' => 'kktfwp-page-settings',
'context' => 'normal',
'priority' => 'high',
'tabs' => array(
'page' => array(
'label' => esc_html__( 'Gallery', 'toppic' ),
'icon' => 'dashicons-format-gallery', // Dashicon
),
'background' => array(
'label' => esc_html__( 'Background', 'toppic' ),
'icon' => 'dashicons-welcome-view-site', // Dashicon
),
),
// Tab style: 'default', 'box' or 'left'. Optional
'tab_style' => 'left',
'fields' => array_merge(
$bgMeta, $parallax,
array(
array(
'name' => esc_html__( 'Gallery layout', 'toppic' ),
'id' => '_gallery_layout_value',
'type' => 'select',
'tab' => 'page',
'options' => array(
'2-column' => esc_html__( '2 Columns', 'toppic' ),
'3-column' => esc_html__( '3 Columns', 'toppic' ),
'4-column' => esc_html__( '4 Columns', 'toppic' ),
'Thumbnails' => esc_html__( 'Thumbnails', 'toppic' ),
'Fullscreen-Grid' => esc_html__( 'Grid (fullscreen)', 'toppic' ),
'Fullscreen' => esc_html__( 'Fullscreen', 'toppic' ),
),
'std' => '2-column',
),
array(
'name' => esc_html__( 'Gallery type', 'toppic' ),
'id' => "{$prefix}proof",
'type' => 'select',
'tab' => 'page',
'class' => 'kk-proofing-gallery',
'options' => array(
'normal' => esc_html__( 'Normal', 'toppic' ),
'proofing' => esc_html__( 'Photo proofing', 'toppic' )
),
'std' => 'normal',
'hidden' => array( '_gallery_layout_value', 'Fullscreen' )
),
array(
'name' => esc_html__( 'Crop images', 'toppic' ),
'desc' => esc_html__( 'Thumbnails are cropped to align', 'toppic' ),
'id' => '_is_masonry_value',
'type' => 'button_group',
'tab' => 'page',
'options' => array(
'No' => esc_html__( 'Yes', 'toppic' ),
'Yes' => esc_html__( 'No', 'toppic' ),
),
'std' => 'No',
'hidden' => array( '_gallery_layout_value', 'in', array( 'Fullscreen-Grid', 'Fullscreen' ) )
),
array(
'name' => esc_html__( 'Image proportions', 'toppic' ),
'id' => '_grid_type_value',
'type' => 'select',
'tab' => 'page',
'options' => array(
'Random' => esc_html__( 'Original', 'toppic' ),
'Square' => esc_html__( 'Square', 'toppic' ),
'Landscape' => esc_html__( 'Landscape', 'toppic' ),
'Portrait' => esc_html__( 'Portrait', 'toppic' ),
),
'std' => 'Random',
'visible' => array( '_gallery_layout_value', 'Fullscreen-Grid' )
),
array(
'name' => esc_html__( 'Transition effect', 'toppic' ),
'id' => '_full_style_value',
'type' => 'select',
'tab' => 'page',
'options' => array(
'Default' => esc_html__( 'Default', 'toppic' ),
'Fade' => esc_html__( 'Fade', 'toppic' ),
'Move' => esc_html__( 'Move', 'toppic' )
),
'std' => 'Default',
'visible' => array( '_gallery_layout_value', 'Fullscreen' )
),
array(
'name' => esc_html__( 'Image scaling', 'toppic' ),
'id' => '_scale_mode_value',
'type' => 'button_group',
'tab' => 'page',
'options' => array(
'Fill' => esc_html__( 'Fill', 'toppic' ),
'Fit' => esc_html__( 'Fit', 'toppic' )
),
'std' => 'Fill',
'visible' => array( '_gallery_layout_value', 'Fullscreen' )
),
array(
'name' => esc_html__( 'Display nearby images', 'toppic' ),
'id' => '_near_by_value',
'type' => 'button_group',
'tab' => 'page',
'options' => array(
'Yes' => esc_html__( 'Yes', 'toppic' ),
'No' => esc_html__( 'No', 'toppic' )
),
'std' => 'No',
'visible' => array(
'when' => array(
array( '_gallery_layout_value', 'Fullscreen' ),
array( '_scale_mode_value', 'Fit' )
),
'relation' => 'and'
)
),
array(
'name' => esc_html__( 'Gallery images', 'toppic' ),
'desc' => esc_html__( 'Select or upload images. Use drag and drop if you need to reorder images. ', 'toppic' ),
'id' => "{$prefix}imgadv",
'type' => 'image_advanced',
'tab' => 'page',
'max_file_uploads' => 0,
),
)
)
);
// POST META
$meta_boxes[] = array(
'title' => esc_html__( 'Page Attributes', 'toppic' ),
'post_types' => array ( 'post' ),
'id' => 'kktfwp-page-settings',
'context' => 'normal',
'priority' => 'high',
'tabs' => array(
'page' => array(
'label' => esc_html__( 'Post Settings', 'toppic' ),
'icon' => 'dashicons-welcome-write-blog', // Dashicon
),
'background' => array(
'label' => esc_html__( 'Background', 'toppic' ),
'icon' => 'dashicons-welcome-view-site', // Dashicon
),
),
// Tab style: 'default', 'box' or 'left'. Optional
'tab_style' => 'left',
'fields' => array_merge(
$bgMeta,
array(
array(
'name' => esc_html__( 'Gallery images', 'toppic' ),
'id' => "{$prefix}imgpost",
'tab' => 'page',
'type' => 'image_advanced',
'max_file_uploads' => 0,
'visible' => array( 'post_format', 'gallery' )
),
array(
'name' => esc_html__( 'Link URL', 'toppic' ),
'desc' => esc_html__( 'Enter the link URL (e.g. http://***.com or http://www.***.com)', 'toppic' ),
'id' => '_post_link_value',
'type' => 'url',
'tab' => 'page',
'visible' => array( 'post_format', 'link' )
),
array(
'name' => esc_html__( 'Quote', 'toppic' ),
'desc' => esc_html__( 'Write your quote here', 'toppic' ),
'id' => '_post_quote_value',
'type' => 'textarea',
'tab' => 'page',
'visible' => array( 'post_format', 'quote' )
),
array(
'name' => esc_html__( 'Quote source', 'toppic' ),
'desc' => esc_html__( 'Write quote source or leave this field blank. HTML tags are allowed.', 'toppic' ),
'id' => '_post_quote_source_value',
'type' => 'text',
'tab' => 'page',
'visible' => array( 'post_format', 'quote' )
),
array(
'name' => esc_html__( 'oEmbed video', 'toppic' ),
'desc' => esc_html__( 'Paste here your oEmbeded code', 'toppic' ),
'id' => '_post_video_value',
'type' => 'textarea',
'tab' => 'page',
'visible' => array( 'post_format', 'video' )
)
), $parallax
)
);
return $meta_boxes;
}

64
extends/widget-flickr.php Normal file
View File

@@ -0,0 +1,64 @@
<?php
// FLICKR WIDGET
add_action('widgets_init', create_function('', 'return register_widget("flickr_widget");'));
class flickr_widget extends WP_Widget{
function __construct() {
$widget_ops = array(
'classname' => 'flickr_widget',
'description' => esc_html__('Display the Flickr photos','toppic')
);
parent::__construct('flickr_widget', esc_html__('Flickr widget','toppic'), $widget_ops);
}
function widget( $args, $instance ){
extract($args);
$title = apply_filters('widget_title', $instance['title']); if(empty($title)) $title="Flickr";
$display = $instance['display'];
$id = $instance['id'];
$number = $instance['number']; if(empty($number)) $number=10;
echo wp_kses_post( $before_widget);
echo wp_kses_post( $before_title.$title.$after_title );?>
<div class="flickr-widget clearfix">
<script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?count=<?php echo esc_js($number); ?>&amp;display=latest&amp;size=s&amp;layout=x&amp;source=user&amp;user=<?php echo esc_js($id); ?>"></script>
</div>
<?php echo wp_kses_post( $after_widget );
}
function update($new_instance, $old_instance){
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
$instance['display'] = $new_instance['display'];
$instance['id'] = $new_instance['id'];
$instance['number'] = $new_instance['number'];
return $instance;
}
function form($instance){
$instance = wp_parse_args((array)$instance, array('title'=>'', 'text'=>'', 'title_link'=>''));
$title = strip_tags($instance['title']);
$display = isset( $instance['display'] ) ? $instance['display'] : false;
$id = isset( $instance['id'] ) ? $instance['id'] : false;
$number = isset( $instance['number'] ) ? $instance['number'] : false;
$text = format_to_edit($instance['text']);?>
<p>
<label><?php esc_html_e('Title:','toppic')?><input class="widefat" id="<?php echo esc_attr( $this->get_field_id(strtolower('title'))) ?>" name="<?php echo esc_attr( $this->get_field_name(strtolower('title'))) ?>" type="text" value="<?php echo esc_attr($title)?>" />
</label>
</p>
<p>
<label><?php printf( esc_html__( 'Flickr ID ( %s ):' , 'toppic' ), '<a href="http://www.idgettr.com" target="_blank">idGettr</a>' ) ?><input class="widefat" id="<?php echo esc_attr( $this->get_field_id(strtolower('id'))) ?>" name="<?php echo esc_attr( $this->get_field_name(strtolower('id'))) ?>" type="text" value="<?php echo esc_attr($id)?>" />
</label>
</p>
<p>
<label><?php esc_html_e('Number of photos:','toppic')?><input class="widefat" id="<?php echo esc_attr( $this->get_field_id(strtolower('number'))) ?>" name="<?php echo esc_attr( $this->get_field_name(strtolower('number'))) ?>" type="text" value="<?php echo esc_attr($number)?>" /></label>
</p>
<?php
}
}

View File

@@ -0,0 +1,70 @@
<?php
// PORTFOLIO
add_action('widgets_init', create_function('', 'return register_widget("toppic_portfolio_widget");'));
class toppic_portfolio_widget extends WP_Widget{
function __construct() {
$widget_ops = array(
'classname' => 'toppic_portfolio_widget',
'description' => esc_html__('Shows a few portfolio works linked to your current work','toppic')
);
parent::__construct( 'portfolio_items', esc_html__('Portfolio widget','toppic'), $widget_ops );
}
function widget($args, $instance){
extract($args);
$title = apply_filters('widget_title', $instance['title']); if(empty($title)) $title= esc_html__('Latest projects','toppic');
$display = $instance['display'];
$number = $instance['number']; if(empty($number)) $number=4;
global $post;
echo wp_kses_post($before_widget);
echo wp_kses_post($before_title.$title.$after_title); ?>
<ul class="kk-portfolio-widget">
<?php
$args = array(
'post_type' => 'portfolio',
'numberposts' => (int)$number,
'exclude' => get_the_ID()
);
$works = get_posts( $args );
foreach ( $works as $work ) {
printf( '<li class="widget-img"><a href="%1$s">%2$s</a></li>',
esc_attr( get_permalink( $work->ID ) ),
get_the_post_thumbnail( $work->ID, 'thumbnail', array( 'data-lazy-load' => 0 ) )
);
}; wp_reset_query(); ?>
</ul>
<?php echo wp_kses_post($after_widget);
}
function update($new_instance, $old_instance){
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
$instance['display'] = $new_instance['display'];
$instance['number'] = $new_instance['number'];
return $instance;
}
function form($instance){
$instance = wp_parse_args((array)$instance, array('title'=>'', 'text'=>'', 'title_link'=>''));
$title = strip_tags($instance['title']);
$display = isset( $instance['display'] ) ? $instance['display'] : false;
$number = isset( $instance['number'] ) ? $instance['number'] : false;
$text = format_to_edit($instance['text']);?>
<p><label><?php esc_html_e( 'Title:', 'toppic' )?><input class="widefat" id="<?php echo esc_attr( $this->get_field_id(strtolower('title'))) ?>" name="<?php echo esc_attr( $this->get_field_name(strtolower('title'))) ?>" type="text" value="<?php echo esc_attr( $title )?>" /></label></p>
<p><label><?php esc_html_e( 'Number of works:', 'toppic' )?><input class="widefat" id="<?php echo esc_attr( $this->get_field_id(strtolower('number'))) ?>" name="<?php echo esc_attr( $this->get_field_name(strtolower('number'))) ?>" type="text" value="<?php echo esc_attr( $number )?>" /></label></p>
<?php
}
}