<?php /** * Kamil OnePage Portfolio * * @package Kamil_OnePage_Portfolio */ if ( ! defined( 'ABSPATH' ) ) { exit; } define( 'KOPP_VERSION', '1.0.0' ); define( 'KOPP_DIR', get_template_directory() ); define( 'KOPP_URI', get_template_directory_uri() ); function kopp_setup() { if ( is_dir( KOPP_DIR . '/languages' ) ) { load_theme_textdomain( 'kamil-onepage-portfolio', KOPP_DIR . '/languages' ); } add_theme_support( 'title-tag' ); add_theme_support( 'post-thumbnails' ); add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) ); add_theme_support( 'custom-logo', array( 'height' => 80, 'width' => 240, 'flex-height' => true, 'flex-width' => true ) ); register_nav_menus( array( 'primary' => __( 'Primary menu', 'kamil-onepage-portfolio' ) ) ); } add_action( 'after_setup_theme', 'kopp_setup' ); function kopp_assets() { wp_enqueue_style( 'kopp-fonts', 'https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap', array(), null ); wp_enqueue_style( 'kopp-main', KOPP_URI . '/assets/css/main.css', array(), KOPP_VERSION ); wp_enqueue_script( 'kopp-main', KOPP_URI . '/assets/js/main.js', array(), KOPP_VERSION, true ); } add_action( 'wp_enqueue_scripts', 'kopp_assets' ); function kopp_sanitize_html_text( $value ) { $allowed = array( 'br' => array(), 'span' => array( 'class' => array() ), 'em' => array(), 'strong' => array(), 'a' => array( 'href' => array(), 'class' => array(), 'target' => array(), 'rel' => array() ), 'p' => array( 'class' => array() ), ); return wp_kses( $value, $allowed ); } function kopp_customize_register( $wp_customize ) { $wp_customize->add_section( 'kopp_hero', array( 'title' => 'Portfolio Hero', 'priority' => 30 ) ); $hero_fields = array( 'kopp_hero_badge' => array( 'label' => 'Badge text', 'default' => 'Profesjonalne strony WWW', 'type' => 'text' ), 'kopp_hero_title' => array( 'label' => 'Main title (HTML: br, span)', 'default' => 'Tworz <span class="kopp-gradient-text">strony</span>,<br>które dziaBaj.', 'type' => 'textarea' ), 'kopp_hero_subtitle' => array( 'label' => 'Subtitle', 'default' => 'Szybkie, dopracowane witryny  od landingów po rozbudowane serwisy w WordPressie.', 'type' => 'textarea' ), 'kopp_hero_cta_primary' => array( 'label' => 'Primary button', 'default' => 'Realizacje', 'type' => 'text' ), 'kopp_hero_cta_secondary' => array( 'label' => 'Secondary button', 'default' => 'Kontakt', 'type' => 'text' ), ); foreach ( $hero_fields as $id => $cfg ) { $wp_customize->add_setting( $id, array( 'default' => $cfg['default'], 'sanitize_callback' => 'kopp_sanitize_html_text' ) ); $ctype = ( isset( $cfg['type'] ) && 'textarea' === $cfg['type'] ) ? 'textarea' : 'text'; $wp_customize->add_control( $id, array( 'label' => $cfg['label'], 'section' => 'kopp_hero', 'type' => $ctype ) ); } $wp_customize->add_section( 'kopp_about', array( 'title' => 'Portfolio About', 'priority' => 31 ) ); $wp_customize->add_setting( 'kopp_about_title', array( 'default' => 'O mnie', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'kopp_about_title', array( 'label' => 'Section title', 'section' => 'kopp_about', 'type' => 'text' ) ); $wp_customize->add_setting( 'kopp_about_text', array( 'default' => 'Skupiam si na wydajno[ci, dostpno[ci i czytelnym kodzie. Pomagam firmom zaistnie w sieci z witrynami, które Baduj si bByskawicznie i wygldaj jak nale|y.', 'sanitize_callback' => 'kopp_sanitize_html_text', ) ); $wp_customize->add_control( 'kopp_about_text', array( 'label' => 'Content', 'section' => 'kopp_about', 'type' => 'textarea' ) ); $wp_customize->add_section( 'kopp_contact', array( 'title' => 'Portfolio Contact', 'priority' => 32 ) ); $wp_customize->add_setting( 'kopp_contact_email', array( 'default' => get_option( 'admin_email' ), 'sanitize_callback' => 'sanitize_email', ) ); $wp_customize->add_control( 'kopp_contact_email', array( 'label' => 'Public email', 'section' => 'kopp_contact', 'type' => 'email' ) ); $wp_customize->add_setting( 'kopp_form_shortcode', array( 'default' => '', 'sanitize_callback' => 'sanitize_textarea_field' ) ); $wp_customize->add_control( 'kopp_form_shortcode', array( 'label' => 'Form shortcode (optional)', 'description' => 'Paste e.g. [contact-form-7 id="123"] to replace the mailto helper.', 'section' => 'kopp_contact', 'type' => 'textarea', ) ); foreach ( array( 'github' => 'GitHub', 'linkedin' => 'LinkedIn', 'twitter' => 'X / Twitter' ) as $key => $lab ) { $sid = 'kopp_social_' . $key; $wp_customize->add_setting( $sid, array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( $sid, array( 'label' => $lab . ' URL', 'section' => 'kopp_contact', 'type' => 'url' ) ); } } add_action( 'customize_register', 'kopp_customize_register' ); /** * @param array $atts Link attributes. * @param WP_Post|object $item Menu item. * @param stdClass $args Menu args. */ function kopp_nav_link_class( $atts, $item, $args ) { if ( ! is_object( $args ) || ! isset( $args->theme_location ) || 'primary' !== $args->theme_location ) { return $atts; } $existing = isset( $atts['class'] ) ? $atts['class'] . ' ' : ''; $atts['class'] = trim( $existing . 'kopp-nav__link' ); return $atts; } add_filter( 'nav_menu_link_attributes', 'kopp_nav_link_class', 10, 3 ); function kopp_mod( $mod, $default = '' ) { $v = get_theme_mod( $mod, $default ); return ( $v !== '' && $v !== null ) ? $v : $default; } function kopp_default_menu() { $items = array( '#kopp-hero' => __( 'Start', 'kamil-onepage-portfolio' ), '#kopp-about' => __( 'O mnie', 'kamil-onepage-portfolio' ), '#kopp-services' => __( 'UsBugi', 'kamil-onepage-portfolio' ), '#kopp-work' => __( 'Portfolio', 'kamil-onepage-portfolio' ), '#kopp-contact' => __( 'Kontakt', 'kamil-onepage-portfolio' ), ); echo '<ul class="kopp-nav__list">'; foreach ( $items as $url => $label ) { echo '<li><a class="kopp-nav__link" href="' . esc_url( $url ) . '">' . esc_html( $label ) . '</a></li>'; } echo '</ul>'; }
Warning: Cannot modify header information - headers already sent by (output started at /home/platne/serwer435309/public_html/autoinstalator/kejmilweb.pl/wordpress157868/wp-content/themes/twentytwentyfour/functions.php:1) in /home/platne/serwer435309/public_html/autoinstalator/kejmilweb.pl/wordpress157868/wp-includes/pluggable.php on line 1531

Warning: Cannot modify header information - headers already sent by (output started at /home/platne/serwer435309/public_html/autoinstalator/kejmilweb.pl/wordpress157868/wp-content/themes/twentytwentyfour/functions.php:1) in /home/platne/serwer435309/public_html/autoinstalator/kejmilweb.pl/wordpress157868/wp-includes/pluggable.php on line 1534