Initial commit

This commit is contained in:
2026-01-15 12:23:11 +01:00
commit 92fc092460
52 changed files with 2283 additions and 0 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

66
404.php Normal file
View File

@@ -0,0 +1,66 @@
<?php
/**
* Strona błędu 404
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.1
*/
get_header();
global $post;
global $wpdb;
$upload_dir = wp_upload_dir();
$most = $wpdb->get_row(
"SELECT sum(count) views, id FROM `wp_statistics_pages` where id not in ( 0,1,3)
group BY `wp_statistics_pages`.`id` order by views desc limit 1"
);
$postMostViewed = get_post( $most->id );
$less = $wpdb->get_row(
"SELECT sum(count) views, id FROM `wp_statistics_pages` where id not in ( 0,1,3)
group BY `wp_statistics_pages`.`id` order by views asc limit 1"
);
$postLessViewed = get_post( $less->id );
$rand = $wpdb->get_row(
"SELECT * FROM `wp_posts` where post_status = 'publish' and post_type = 'post' and id not in ( $postMostViewed->ID, $postLessViewed->ID ) order by rand() limit 1"
);
$postRandViewed = get_post( $rand->ID ); ?>
<main class="content" id="main">
<article class="container">
<div class="row">
<div class="col-lg-12 col-xs-12">
<h2>Błąd 404</h2>
<?php get_template_part('template-parts/content/content-none'); ?>
</div>
<div class="col-lg-12 col-xs-12">
<h5>Jeśli nie znalazłeś interesującego artykułu możesz zajrzeć do jedego z poniższych</h5>
</div>
<div class="col-lg-4 col-xs-12">
<a href="<?php echo esc_url( get_permalink($postMostViewed->ID) ); ?>">
<?php echo get_the_post_thumbnail( $postMostViewed->ID, 'thumbnail', array( 'class' => 'alignleft' ) ); ?>
</a>
</div>
<div class="col-lg-4 col-xs-12">
<a href="<?php echo esc_url( get_permalink($postLessViewed->ID) ); ?>">
<?php echo get_the_post_thumbnail( $postLessViewed->ID, 'thumbnail', array( 'class' => 'alignleft' ) ); ?>
</a>
</div>
<div class="col-lg-4 col-xs-12">
<a href="<?php echo esc_url( get_permalink($postRandViewed->ID) ); ?>">
<?php echo get_the_post_thumbnail( $postRandViewed->ID, 'thumbnail', array( 'class' => 'alignleft' ) ); ?>
</a>
</div>
</div>
</article>
</main>
<?php get_footer();

1
README.md Normal file
View File

@@ -0,0 +1 @@
# tylkofotografia

118
comments.php Normal file
View File

@@ -0,0 +1,118 @@
<?php
/**
* Komentarze
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.1
*/
if ( post_password_required() ) {
return;
}
if ( comments_open() ) {
?>
<div class="container">
<div class="row">
<div id="comments" class="comments-area offset-lg-2 col-lg-8 col-xs-12">
<?php if ( have_comments() ) : ?>
<h2 class="comments-title">
<?php $comments_number = get_comments_number();
if ( '1' === $comments_number ) {
printf( _x( 'Jedna odpowiedź do &ldquo;%s&rdquo;', 'comments title' ), get_the_title() );
} else {
printf(_nx(
'%1$s Reply to &ldquo;%2$s&rdquo;',
'%1$s Odpowiedzi do &ldquo;%2$s&rdquo;',
$comments_number,
'comments title'
),
number_format_i18n( $comments_number ),
get_the_title()
);
}
?>
</h2>
<ol class="comment-list">
<?php
wp_list_comments( array(
'avatar_size' => 32,
'style' => 'ol',
'short_ping' => true,
) );
?>
</ol>
<?php endif;
if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
<p class="no-comments"><?php _e( 'Comments are closed.', 'foto' ); ?></p>
<?php endif;
ob_start();
$commenter = wp_get_current_commenter();
$req = true;
$aria_req = ( $req ? " aria-required='true'" : '' );
$comments_arg = array(
'form' => array(
'class' => 'form-horizontal'
),
'fields' => apply_filters( 'comment_form_default_fields', array(
'autor' => '<div class="col-lg-6"><div class="form-group">' . '<label for="author">' . __( 'Imię - wymagane', 'foto' ) . '</label> ' . ( $req ? '<span>*</span>' : '' ) .
'<input id="author" name="author" class="form-control" type="text" value="" size="30"' . $aria_req . ' />'.
'<p id="d1" class="text-danger"></p>' . '</div></div>',
'email' => '<div class="col-lg-6"><div class="form-group">' .'<label for="email">' . __( 'Email - wymagany', 'foto' ) . '</label> ' . ( $req ? '<span>*</span>' : '' ) .
'<input id="email" name="email" class="form-control" type="text" value="" size="30"' . $aria_req . ' />'.
'<p id="d2" class="text-danger"></p>' . '</div></div></div></div>',
'url' => '')),
'comment_field' => '<div class="container"><div class="row"><div class="col-lg-12"><div class="form-group">' . '<label for="comment">' . __( 'Komentarz', 'foto' ) . '</label><span>*</span>' .
'<textarea id="comment" class="form-control" name="comment" rows="3" aria-required="true"></textarea><p id="d3" class="text-danger"></p>' . '</div></div>',
'comment_notes_after' => '',
'class_submit' => 'btn btn-primary'
);
comment_form($comments_arg);
echo str_replace('class="comment-form"','class="comment-form" name="commentForm" onsubmit="return validateForm();"',ob_get_clean());
?>
<script>
function validateForm() {
var form = document.forms.commentForm,
x = form.author.value,
y = form.email.value,
z = form.comment.value,
flag = true,
d1 = document.getElementById("d1"),
d2 = document.getElementById("d2"),
d3 = document.getElementById("d3");
if (x === null || x === "") {
d1.innerHTML = "<?php echo __('Imię jest wymagane', 'foto'); ?>";
flag = false;
} else {
d1.innerHTML = "";
}
if (y === null || y === "") {
d2.innerHTML = "<?php echo __('Email jest wymagany', 'foto'); ?>";
flag = false;
} else {
d2.innerHTML = "";
}
if (z === null || z === "") {
d3.innerHTML = "<?php echo __('Komentarz jest wymagany', 'foto'); ?>";
flag = false;
} else {
d3.innerHTML = "";
}
return flag;
}
</script>
</div>
</div>
</div>
</div>
</div>
</div>
<?php }

6
css/all.min.css vendored Normal file

File diff suppressed because one or more lines are too long

7
css/bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

15
footer.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
/**
* Stopka
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.1
*/
get_template_part("template-parts/footer/footer");
wp_footer();
?>
</body>
</html>

27
functions.php Normal file
View File

@@ -0,0 +1,27 @@
<?php
/**
* Funkcje motywu
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.2
*/
include_once ABSPATH . "wp-admin/includes/plugin.php";
function custom_login_logo() {
echo '<style type="text/css">
h1 a {
background-image:url(https://tylkofotografia.pl/wp-content/themes/tylkofotografia.pl/favicon/TylkoFotografia-logo-icon.png) !important;
}
</style>';
}
add_action('login_head', 'custom_login_logo');
if (file_exists(dirname(__FILE__) . "/inc/autoload.php")) {
require_once dirname(__FILE__) . "/inc/autoload.php";
}
if (class_exists("Init")) {
Init::getInstance();
}

51
header.php Normal file
View File

@@ -0,0 +1,51 @@
<?php
/**
* Nagłowek
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.2
*/
$directory_uri = get_stylesheet_directory_uri();
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<link rel="preload" href="<?php echo $directory_uri; ?>/fonts/maven-pro-v32-latin-ext.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="<?php echo $directory_uri; ?>/fonts/maven-pro-v32-latin-regular.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="<?php echo $directory_uri; ?>/tylkofotografia.pl/fonts/maven-pro-v32-latin-600-ext.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="<?php echo $directory_uri; ?>fonts/maven-pro-v32-latin-600.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="<?php echo $directory_uri; ?>/webfonts/fa-brands-400.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="<?php echo $directory_uri; ?>/webfonts/fa-regular-400.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="<?php echo $directory_uri; ?>/webfonts/fa-solid-900.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" as="script" href="https://tylkofotografia.pl/wp-content/plugins/akismet/_inc/akismet-frontend.js">
<style>
@font-face {font-family: 'Maven Pro';font-style: normal;font-weight: 400;font-display: swap;src: url('<?php echo $directory_uri; ?>/fonts/maven-pro-v32-latin-ext.woff2') format('woff2');unicode-range: U + 0100-024F, U + 0259, U + 1E00-1EFF, U + 2020, U + 20A0-20AB, U + 20AD-20CF, U + 2113, U + 2C60-2C7F, U + A720-A7FF }@font-face {font-family: 'Maven Pro';font-style: normal;font-weight: 400;font-display: swap;src: url('<?php echo $directory_uri; ?>/fonts/maven-pro-v32-latin-regular.woff2') format('woff2');unicode-range: U + 0000-00FF, U + 0131, U + 0152-0153, U + 02BB-02BC, U + 02C6, U + 02DA, U + 02DC, U + 2000-206F, U + 2074, U + 20AC, U + 2122, U + 2191, U + 2193, U + 2212, U + 2215, U + FEFF, U + FFFD }@font-face {font-family: 'Maven Pro';font-style: normal;font-weight: 600;font-display: swap;src: url('<?php echo $directory_uri; ?>/fonts/maven-pro-v32-latin-600-ext.woff2') format('woff2');unicode-range: U + 0100-024F, U + 0259, U + 1E00-1EFF, U + 2020, U + 20A0-20AB, U + 20AD-20CF, U + 2113, U + 2C60-2C7F, U + A720-A7FF }@font-face {font-family: 'Maven Pro';font-style: normal;font-weight: 600;font-display: swap;src: url('<?php echo $directory_uri; ?>/fonts/maven-pro-v32-latin-600.woff2') format('woff2');unicode-range: U + 0000-00FF, U + 0131, U + 0152-0153, U + 02BB-02BC, U + 02C6, U + 02DA, U + 02DC, U + 2000-206F, U + 2074, U + 20AC, U + 2122, U + 2191, U + 2193, U + 2212, U + 2215, U + FEFF, U + FFFD }
</style>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="follow.it-verification-code" content="mccEeDLbmcjazpN75J7L"/>
<meta name="ahrefs-site-verification" content="b57bccf8d98320812a4eaceed3c59c4536bd54ef6ec50b6cb4cba5ff55b1c608">
<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<meta name="apple-mobile-web-app-title" content="TylkoFotografia" />
<link rel="manifest" href="/site.webmanifest" />
<meta name="application-name" content="TylkoFotografia"/>
<!-- MailerLite Universal -->
<script>
(function(w,d,e,u,f,l,n){w[f]=w[f]||function(){(w[f].q=w[f].q||[])
.push(arguments);},l=d.createElement(e),l.async=1,l.src=u,
n=d.getElementsByTagName(e)[0],n.parentNode.insertBefore(l,n);})
(window,document,'script','https://assets.mailerlite.com/js/universal.js','ml');
ml('account', '1025353');
</script>
<!-- End MailerLite Universal -->
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php
if ( function_exists('wp_body_open') ) { wp_body_open(); }
get_template_part( 'template-parts/header/headerImage' );
get_template_part( 'template-parts/navigation/main' );

1
image.php Normal file
View File

@@ -0,0 +1 @@
<?php wp_redirect(get_permalink($post->post_parent)) ; ?>

BIN
inc/.DS_Store vendored Normal file

Binary file not shown.

35
inc/autoload.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
/**
* Autoloader klas
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.2
*/
function classAutoload($class) {
$class = str_replace('\\', '/', $class);
$path = dirname(__FILE__).'/classes/'.$class.'.php';
if (is_readable($path)) {
require_once $path;
return;
}
};
spl_autoload_register('classAutoload');
function traitAutoload($trait) {
$trait = str_replace('\\', '/', $trait);
$path = dirname(__FILE__).'/traits/'.$trait.'.php';
if (is_readable($path)) {
require_once $path;
return;
}
}
spl_autoload_register('traitAutoload');

View File

@@ -0,0 +1,50 @@
<?php
/**
* Klasa Breadcrumbs
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.2
*/
class Breadcrumbs {
use Singleton;
public static function postBreadcrumbs()
{
global $wpdb, $post;
$result = $wpdb->get_results("SELECT T2.id, T2.post_title, T2.post_name, T2.post_status
FROM (
SELECT
@r AS _id,
(SELECT @r := post_parent FROM {$wpdb->prefix}posts WHERE id = _id) AS post_parent,
@l := @l + 1 AS lvl
FROM
(SELECT @r := " . $post->ID . ", @l := 0) vars,
wp_posts h
WHERE @r <> 0) T1
JOIN wp_posts T2
ON T1._id = T2.id
ORDER BY T1.lvl DESC;");
$counter = count($result);
$link = '<a href="' . get_site_url() . '/" >' . get_bloginfo('name') . '</a>';
$link .= ' / ';
foreach ($result as $page)
{
if ($page->post_status != 'draft') {
$link .= '<a href="' . get_permalink( $page->id ) . '" >' . $page->post_title . '</a>';
} else {
$link .= '' . $page->post_title . '';
}
$counter--;
if ($counter > 0)
{
$link .= ' / ';
}
}
return $link;
}
}

30
inc/classes/Character.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
/**
* Klasa Tables
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.2
*/
class Character {
use Singleton;
function __construct() {
$this->setupFilter();
}
protected function setupFilter() {
add_filter( 'the_content', [$this, 'fontAwesome'] );
}
public function fontAwesome( $content ) {
$content = str_replace(
[ '%v%', '%x%' ],
[ '<i class="fa-solid fa-check text-success"></i>', '<i class="fa-solid fa-xmark text-danger
"></i>'],
$content
);
return $content;
}
}

40
inc/classes/Enqueue.php Normal file
View File

@@ -0,0 +1,40 @@
<?php
/**
* Klasa Enqueue
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.2
*/
class Enqueue {
use Singleton;
function __construct() {
add_action('wp_enqueue_scripts',[ $this, 'enqueueScripts']);
}
public function enqueueScripts() {
wp_register_style('style', get_stylesheet_uri(), [], filemtime( get_template_directory() . '/style.css'), 'all');
wp_register_style('bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', [], false, 'all');
wp_register_style('fontawesome', get_template_directory_uri() . '/css/all.min.css', [], false, 'all');
wp_register_script('bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', [], false, 'all');
wp_register_script('newsletter', get_template_directory_uri() . '/js/newsletter.js', [], false, 'all');
wp_register_script('lightbox', get_template_directory_uri() . '/js/index.bundle.min.js', [], false, 'all');
wp_enqueue_style('bootstrap');
wp_enqueue_style('fontawesome');
wp_enqueue_style('style');
wp_enqueue_script('bootstrap');
wp_enqueue_script('lightbox');
if ( is_plugin_active( 'newsletter/plugin.php' ) ) {
wp_enqueue_script('newsletter');
}
}
}

43
inc/classes/Excerpt.php Normal file
View File

@@ -0,0 +1,43 @@
<?php
/**
* Klasa Excerpt
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.2
*/
class Excerpt {
use Singleton;
function __construct() {
}
public static function improvedExcerpt($text, $length)
{
global $shortcode_tags;
if ('' != $text)
{
$text = get_the_content('');
$text = strip_shortcodes($text);
$text = apply_filters('the_content', $text);
$text = str_replace('\]\]\>', ']]&gt;', $text);
$text = preg_replace('@<script[^>]*?>.*?</script>@si', '', $text);
$text = preg_replace('@<figcaption[^>]*?>.*?</figcaption>@si', '', $text);
$text = strip_tags($text);
$text = trim($text);
$words = explode(' ', $text, $length + 1);
if (count($words) > $length)
{
array_pop($words);
$text = trim(implode(' ', $words)) . '...';
}
}
$text = preg_replace('/\s\s+/', ' ', $text);
return $text;
}
}

23
inc/classes/Init.php Normal file
View File

@@ -0,0 +1,23 @@
<?php
/**
* Klasa Init
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.2
*/
class Init {
use Singleton;
function __construct() {
Setup::getInstance();
Enqueue::getInstance();
Menus::getInstance();
Character::getInstance();
Tables::getInstance();
}
}

58
inc/classes/Menus.php Normal file
View File

@@ -0,0 +1,58 @@
<?php
/**
* Klasa Menus
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.2
*/
class Menus {
use Singleton;
function __construct() {
$this->setupHooks();
}
protected function setupHooks() {
add_action( 'init', [ $this, 'registerMenus' ]);
}
public function registerMenus()
{
register_nav_menus([
'tf-header-menu' => esc_html__('Header Menu', 'tylkofotografia') ,
'tf-footer-menu' => esc_html__('Footer Menu', 'tylkofotografia')
]);
}
public function get_menu_id( $location ) {
$locations = get_nav_menu_locations();
if (!empty($locations)) {
return $locations[$location];
} else {
return '';
}
}
public function get_child_menu_items( $menu_array, $parent_id ) {
$child_menus = [];
if ( ! empty( $menu_array ) && is_array( $menu_array ) ) {
foreach ( $menu_array as $menu ) {
if ( intval( $menu->menu_item_parent ) === $parent_id ) {
array_push( $child_menus, $menu );
}
}
}
return $child_menus;
}
}

39
inc/classes/Setup.php Normal file
View File

@@ -0,0 +1,39 @@
<?php
/**
* Klasa Setup
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.2
*/
class Setup {
use Singleton;
function __construct() {
$this->setupTheme();
}
protected function setupHooks() {
add_action( 'after_setup_theme', [ $this, 'setupTheme' ] );
}
public function setupTheme() {
add_theme_support( 'title-tag' );
add_theme_support( 'post-thumbnails' );
add_theme_support(
'html5',
[
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
'script',
'style',
]
);
add_theme_support( 'custom-header' );
}
}

32
inc/classes/Tables.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
/**
* Klasa Tables
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.2
*/
class Tables {
use Singleton;
function __construct() {
$this->setupFilter();
}
protected function setupFilter() {
add_filter( 'the_content', [$this, 'bootstrapResponsiveTable'] );
}
public function bootstrapResponsiveTable( $content ) {
$content = preg_replace('/<table[^>]*class=["\'][^"\']*["\']/i', '<table', $content);
$content = str_replace(
[ '<table>', '</table>' ],
[ '<table class="table table-bordered table-hover table-sm">', '</table>' ],
$content
);
return $content;
}
}

27
inc/traits/Singleton.php Normal file
View File

@@ -0,0 +1,27 @@
<?php
/**
* Cecha singleton
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.2
*/
trait Singleton {
private static $instances = [];
protected function __construct() { }
final protected function __clone() { }
public static function getInstance() {
$class = get_called_class();
if ( !isset( $instances[$class])) {
$instances[$class] = new $class;
}
return $instances[$class];
}
}

121
index.php Normal file
View File

@@ -0,0 +1,121 @@
<?php
/**
* Glówny plik motywu
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.2
*/
$postcount = 0;
$paged = get_query_var("paged") ? get_query_var("paged") : 1;
$tag = get_query_var("tag_id") ? get_query_var("tag_id") : "";
$category = get_query_var("cat");
$args = [
"post_type" => ["post", "page"],
"posts_per_page" => 10, // Set the number of posts per page
"paged" => $paged, // Set the page number
"tag_id" => $tag,
"cat" => $category, // Filter by category ID
//'tag__not_in' => array(120), Filter by excluding a specific tag ID
"post_status" => "publish",
"post__not_in" => [
2421,
796,
324,
1338,
1743,
263,
260,
3,
1615,
1713,
360,
906,
1071,
339,
336,
],
];
$the_query = new WP_Query($args);
Excerpt::getInstance();
get_header();
?>
<main>
<div class="content" id="main">
<div class="container">
<div id="primary" class="row content">
<?php if ($the_query->have_posts()) {
while ($the_query->have_posts()):
$the_query->the_post();
$postcount++;
?>
<article id="post-<?php the_ID(); ?>" class="col-lg-6 col-xs-12 front-page mb-5">
<?php if (has_post_thumbnail()) { ?>
<a href="<?php the_permalink($post->ID); ?>">
<figure class="text-center">
<?php if ($postcount < 5) {
the_post_thumbnail("large", ["loading" => ""]);
} else {
the_post_thumbnail("large", ["loading" => "lazy"]);
} ?>
</figure>
</a>
<div class="d-flex justify-content-between bd-highlight mb-2">
<div class="p-2 bd-highlight">
<small><i class="fas fa-user"></i> <?php the_author(); ?></small>
</div>
<div class="p-2 text-center">
<i class="fab fa-youtube"></i> <?php
$categories = get_the_category();
echo $categories[0]->name;
?>
</div>
<div class="p-2 bd-highlight">
<small ><i class="far fa-clock"></i><time> <?php echo get_the_date(); ?><time></small>
</div>
</div>
<div style="margin:auto">
<div class="col-12 h-100">
<p style="min-height: 100px;">
<?php echo get_the_excerpt(); ?>
</p>
<p class="text-right"><a href="<?php echo get_the_permalink(
$postId,
); ?>">Więcej...</a></p>
</div>
</div>
<hr />
<?php } ?>
</article>
<?php if ($postcount % 2 == 0) { ?>
</div><div class="row content">
<?php } ?>
<?php
endwhile;
} else {
get_template_part("template-parts/content/nocontent");
} ?>
</div>
<nav class="d-flex justify-content-between bd-highlight mb-2" role="navigation">
<div class="p-2 bd-highlight"><?php next_posts_link(
'<i class="fas fa-arrow-left"></i> Starsze posty',
); ?></div>
<div class="p-2 bd-highlight"><?php previous_posts_link(
'Nowsze posty <i class="fas fa-arrow-right"></i>',
); ?></div>
</nav>
</div>
</div>
</main>
<?php get_footer();

1
js/bootstrap.min.js vendored Normal file

File diff suppressed because one or more lines are too long

6
js/index.bundle.min.js vendored Normal file

File diff suppressed because one or more lines are too long

135
page-contact.php Normal file
View File

@@ -0,0 +1,135 @@
<?php
/**
* Template Name: Formularz kontaktowy
* Template Post Type: post, page
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.1
*/
get_header();
global $post;
global $wpdb;
$upload_dir = wp_upload_dir();
$image = $wpdb->get_row(
"SELECT * FROM {$wpdb->prefix}responsive_images where `img_filetype` in ('jpg', 'png') and `img_size` = 'hr' and `img_post_id` = " .
get_post_thumbnail_id($post->ID),
);
$webp = $wpdb->get_row(
"SELECT * FROM {$wpdb->prefix}responsive_images where `img_filetype` in ('webp') and `img_size` = 'hr' and `img_post_id` = " .
get_post_thumbnail_id($post->ID),
);
if (wp_is_mobile()) {
$image = $wpdb->get_row(
"SELECT * FROM {$wpdb->prefix}responsive_images where `img_filetype` in ('jpg', 'png') and `img_size` = 'hrmb' and `img_post_id` = " .
get_post_thumbnail_id($post->ID),
);
$webp = $wpdb->get_row(
"SELECT * FROM {$wpdb->prefix}responsive_images where `img_filetype` in ('webp') and `img_size` = 'hrmb' and `img_post_id` = " .
get_post_thumbnail_id($post->ID),
);
}
if (!empty($image)) {
$time = filemtime($upload_dir["basedir"] . $image->img_location);
}
if (!empty($webp)) {
$webpset =
'"' .
$upload_dir["baseurl"] .
$image->img_location .
'" type("image/webp"), ';
} else {
$webpset = "";
}
if (!empty($image)) {
$jpgpset =
'"' .
$upload_dir["baseurl"] .
$image->img_location .
'" type("image/jpg")'; ?>
<?php if (have_posts()):
while (have_posts()):
the_post(); ?>
<?php if (!wp_is_mobile()) { ?>
<div class="page-hero" style='background-image: linear-gradient(0deg, rgba(28,47,64,0.7),rgba(47,72,103,0.7)), url("<?php echo $upload_dir[
"baseurl"
] .
$webp->img_location; ?>?x=<?php echo $time; ?>"); background-repeat: no-repeat; background-position: top; background-size: cover; height:585px'>
<div class="container col-lg-6 col-xs-12">
<div class="row" style="color:#fff">
<div style="padding-top: calc(18% + 190px)">
<h1 class="post-title text-center mb-5" ><?php the_title(); ?></h1>
<?php the_excerpt(); ?>
<p></p>
</div>
</div>
</div>
</div>
<article class="container col-lg-8 col-xs-12 test4">
<?php } else { ?>
<div >
<div class="img-container" style='margin-top: 70px;'>
<figure class="wp-caption image">
<picture>
<source srcset="<?php echo $upload_dir["baseurl"] .
webp->img_location; ?>?x=<?php echo $time; ?>" type="image/webp">
<source srcset="<?php echo $upload_dir["baseurl"] .
$image->img_location; ?>?x=<?php echo $time; ?>" type="image/jpeg">
<img src="<?php echo $upload_dir["baseurl"] .
$image->img_location; ?>?x=<?php echo $time; ?>">
</picture>
</figure>
<div class="overlay">
<div class="text">
<div style="padding-top: 0px">
<h1 class="post-title text-center mb-5" ><?php the_title(); ?></h1>
<?php the_excerpt(); ?>
<p></p>
</div>
</div>
</div>
</div>
</div>
<article class="container col-lg-8 col-xs-12 test4">
<?php } ?>
<div class="row">
<div class="offset-lg-2 col-lg-8 col-xs-12">
<?php the_content(); ?>
</div>
</div>
</article>
<?php
endwhile;
else:
get_template_part("template-parts/content/content-none");
endif;
}
?>
<?php
comments_template();
get_footer();

79
page-simple.php Normal file
View File

@@ -0,0 +1,79 @@
<?php
/**
* Template Name: Prosta strona
* Template Post Type: post, page
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.1
*/
get_header();
global $post;
global $wpdb;
$upload_dir = wp_upload_dir();
$image = $wpdb->get_row(
"SELECT * FROM {$wpdb->prefix}responsive_images where `img_filetype` in ('jpg', 'png') and `img_size` = 'hr' and `img_post_id` = " .
get_post_thumbnail_id($post->ID),
);
$webp = $wpdb->get_row(
"SELECT * FROM {$wpdb->prefix}responsive_images where `img_filetype` in ('webp') and `img_size` = 'hr' and `img_post_id` = " .
get_post_thumbnail_id($post->ID),
);
if (!empty($image)) {
$time = filemtime($upload_dir["basedir"] . $image->img_location);
}
if (!empty($webp)) {
$webpset =
'"' .
$upload_dir["baseurl"] .
$image->img_location .
'" type("image/webp"), ';
} else {
$webpset = "";
}
?>
<?php
if (have_posts()):
while (have_posts()):
the_post(); ?>
<div class="page-hero" style='background-image: linear-gradient(0deg, rgba(28,47,64,0.7),rgba(47,72,103,0.7)), url("<?php echo $upload_dir[
"baseurl"
] .
$webp->img_location; ?>?x=<?php echo $time; ?>"); background-repeat: no-repeat; background-position: top; background-size: cover; height:585px
'>
<div class="container col-lg-8 col-xs-12">
<div class="row" style="color:#fff">
<div style="padding-top: calc(18% + 190px)">
<h1 class="post-title text-center mb-5" ><?php the_title(); ?></h1>
<?php the_excerpt(); ?>
<?php get_template_part("template-parts/content/content-meta"); ?>
</div>
</div>
</div>
</div>
<article class="container col-lg-8 col-xs-12 test4">
<div class="row">
<div class="offset-lg-2 col-lg-8 col-xs-12">
<nav id="breadcrumbs" class="breadcrumbs mb-5"><?php echo Breadcrumbs::postBreadcrumbs(); ?></nav>
<?php the_content(); ?>
</div>
</div>
</article>
<?php
endwhile;
else:
get_template_part("template-parts/content/content-none");
endif;
comments_template();
get_footer();

158
page.php Normal file
View File

@@ -0,0 +1,158 @@
<?php
/**
* Pojedyncza strona
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.1
*/
get_header();
global $post;
global $wpdb;
$upload_dir = wp_upload_dir();
$image = $wpdb->get_row(
"SELECT * FROM {$wpdb->prefix}responsive_images where `img_filetype` in ('jpg', 'png') and `img_size` = 'hr' and `img_post_id` = " .
get_post_thumbnail_id($post->ID)
);
$webp = $wpdb->get_row(
"SELECT * FROM {$wpdb->prefix}responsive_images where `img_filetype` in ('webp') and `img_size` = 'hr' and `img_post_id` = " .
get_post_thumbnail_id($post->ID)
);
if (wp_is_mobile()) {
$image = $wpdb->get_row(
"SELECT * FROM {$wpdb->prefix}responsive_images where `img_filetype` in ('jpg', 'png') and `img_size` = 'hrmb' and `img_post_id` = " .
get_post_thumbnail_id($post->ID)
);
$webp = $wpdb->get_row(
"SELECT * FROM {$wpdb->prefix}responsive_images where `img_filetype` in ('webp') and `img_size` = 'hrmb' and `img_post_id` = " .
get_post_thumbnail_id($post->ID)
);
}
if (!empty($image)) {
$time = filemtime($upload_dir["basedir"] . $image->img_location);
}
if (!empty($webp)) {
$webpset = '"' . $upload_dir["baseurl"] . $image->img_location . '" type("image/webp"), ';
} else {
$webpset = "";
}
if (!empty($image)) {
$jpgpset = '"' . $upload_dir["baseurl"] . $image->img_location . '" type("image/jpg")';
?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php if(!wp_is_mobile()) { ?>
<div class="page-hero" style='background-image: linear-gradient(0deg, rgba(28,47,64,0.7),rgba(47,72,103,0.7)), url("<?php echo $upload_dir["baseurl"] . $webp->img_location; ?>?x=<?php echo $time ?>"); background-repeat: no-repeat; background-position: top; background-size: cover; height:585px'>
<div class="container col-lg-6 col-xs-12">
<div class="row" style="color:#fff">
<div style="padding-top: calc(18% + 190px)">
<h1 class="post-title text-center mb-5" ><?php the_title(); ?></h1>
<?php the_excerpt() ?>
<?php get_template_part('template-parts/content/content-meta'); ?>
</div>
</div>
</div>
</div>
<article class="container col-lg-8 col-xs-12 test4">
<?php } else { ?>
<div >
<div class="img-container" style='margin-top: 70px;'>
<figure class="wp-caption image">
<picture>
<source srcset="<?php echo $upload_dir["baseurl"] . webp->img_location; ?>?x=<?php echo $time ?>" type="image/webp">
<source srcset="<?php echo $upload_dir["baseurl"] . $image->img_location; ?>?x=<?php echo $time ?>" type="image/jpeg">
<img src="<?php echo $upload_dir["baseurl"] . $image->img_location; ?>?x=<?php echo $time ?>">
</picture>
</figure>
<div class="overlay">
<div class="text">
<div style="padding-top: 0px">
<h1 class="post-title text-center mb-5" ><?php the_title(); ?></h1>
<?php the_excerpt() ?>
<?php get_template_part('template-parts/content/content-meta-mb'); ?>
</div>
</div>
</div>
</div>
</div>
<article class="container col-lg-8 col-xs-12 test4">
<?php } ?>
<div class="row">
<div class="col-lg-8 col-xs-12">
<nav id="breadcrumbs" class="breadcrumbs mb-5"><?php echo Breadcrumbs::postBreadcrumbs() ?></nav>
<?php the_content(); ?>
</div>
<aside class="col-lg-4 col-xs-12"><?php get_sidebar(); ?></aside>
</div>
</article>
<?php endwhile; else:
get_template_part('template-parts/content/content-none');
endif;
} else {
?>
<main class="content" id="main">
<article class="container col-lg-6 col-xs-12 test2">
<div class="row">
<div>
<nav id="breadcrumbs" class="breadcrumbs mb-5"><?php echo Breadcrumbs::postBreadcrumbs() ?></nav>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2401815550643539"
crossorigin="anonymous">
</script>
<!-- Sidebar -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-2401815550643539"
data-ad-slot="6894360927"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_excerpt() ?>
<?php get_template_part('template-parts/content/content-meta'); ?>
<h1 class="post-title text-center mb-5"><?php the_title(); ?></h1>
<?php the_content(); ?>
</div>
<?php wp_link_pages(array('before' => '<p><strong>Strona:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
<?php endwhile; else:
get_template_part('template-parts/content/content-none');
endif; ?>
</div>
</div>
</article>
</main>
<?php
} ?>
<?php comments_template();
get_footer();

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 KiB

129
search.php Normal file
View File

@@ -0,0 +1,129 @@
<?php
/**
* Strona wyników wyszukiwania
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.2
*/
$postcount = 0;
get_header(); ?>
<main>
<?php if ( have_posts() ) {
?>
<div class="content" id="main" style="margin-top: 60px;">
<div class="container">
<div class="row">
<div class="col">
<h2 class="text-center">
<?php
printf(
/* translators: %s: Search term. */
esc_html__( 'Wyniki wyszukiwania dla frazy "%s"', 'twentytwentyone' ),
'<span class="page-description search-term">' . esc_html( get_search_query() ) . '</span>'
);
?>
</h2>
<p class="text-center">
<?php
printf(
esc_html(
/* translators: %d: The number of search results. */
_n(
'Znaleziono %d wynik.',
'Znaleziono %d wyników.',
(int) $wp_query->found_posts,
'twentytwentyone'
)
),
(int) $wp_query->found_posts
);
?>
</p>
</div>
</div>
</div>
<div class="content" id="main">
<div class="container">
<div id="primary" class="row content">
<?php
while ( $wp_query->have_posts() ) : $wp_query->the_post();
$postcount++ ?>
<article id="post-<?php the_ID(); ?>" class="col-lg-6 col-xs-12 front-page mb-5">
<?php if ( has_post_thumbnail() ) {?>
<div class="img-container">
<a class="read-more" href="<?php the_permalink($post->ID); ?>">
<figure class="wp-caption image">
<?php if ($postcount < 5 ) {
the_post_thumbnail( 'large', array( 'loading' => '' ) );
} else {
the_post_thumbnail( 'large', array( 'loading' => 'lazy' ) );
} ?>
</figure>
<div class="overlay">
<div class="text">
<h2><?php echo Excerpt::improvedExcerpt(the_title(), 5); ?></h2>
<?php the_excerpt(); ?>
</div>
</div>
</a>
</div>
<div class="d-flex justify-content-between bd-highlight mb-2">
<div class="p-2 bd-highlight">
<small><i class="fas fa-user"></i> <?php the_author(); ?></small>
</div>
<!--<div class="col-4 text-center">
<i class="fab fa-youtube"></i> <?php echo get_the_category( $id )[0]->name ?>
</div>-->
<div class="p-2 bd-highlight">
<small ><i class="far fa-clock"></i><time> <?php echo get_the_date(); ?><time></small>
</div>
</div>
<?php } ?>
</article>
<?php if ($postcount % 2 == 0 ) { ?>
</div><div class="row content">
<?php } ?>
<?php endwhile;
?></div><!-- .search-result-count -->
</div></div></div><div class="container">
<div class="row">
<div class="col-lg-12 col-xs-12 front-page mb-5"><nav class="d-flex justify-content-between bd-highlight mb-2" role="navigation">
<div class="p-2 bd-highlight"><?php next_posts_link( '<i class="fas fa-arrow-left"></i> Starsze posty' ); ?></div>
<div class="p-2 bd-highlight"><?php previous_posts_link( 'Nowsze posty <i class="fas fa-arrow-right"></i>' ); ?></div>
</nav>
</div>
</div><?php
} else {
?><div class="container">
<div class="row">
<div class="col-lg-12 col-xs-12"><?php
get_template_part( 'template-parts/content/content-none' );
?>
</div>
</div>
</div>
<?php
}
?>
</main>
<?php
get_footer();

20
searchform.php Normal file
View File

@@ -0,0 +1,20 @@
<?php
/**
* Wyszukiwarka
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.2
*/
?>
<section class="searchform">
<form class="d-flex" method="get" action="/index.php">
<input class="form-control me-2" type="search" name="s" placeholder="Szukaj na stronie..." aria-label="Search">
<button class="btn btn-outline-dark" type="submit">
<i class="fas fa-search"></i>
</button>
</form>
</section>

80
sidebar.php Normal file
View File

@@ -0,0 +1,80 @@
<?php
/**
* Sidebar
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.2
*/
global $post;
global $wpdb;
$postLessViewed = 0;
$postRandViewed = 0;
$upload_dir = wp_upload_dir();
$currentPost_id = get_the_ID();
$most = $wpdb->get_row(
"SELECT sum(count) views, id FROM `wp_statistics_pages` where id not in ( 0,1, $currentPost_id) and type = 'post' group BY `wp_statistics_pages`.`id` order by views desc limit 1"
);
$postMostViewed = get_post( $most->id );
$less = $wpdb->get_row(
"SELECT sum(count) views, id FROM `wp_statistics_pages` where id not in ( 0,1, $currentPost_id) and type = 'post' group BY `wp_statistics_pages`.`id` order by views asc limit 1"
);
if ($less) {
$postLessViewed = get_post( $less->id );
}
$rand = $wpdb->get_row(
"SELECT * FROM `wp_posts` where post_status = 'publish' and post_type = 'post' and id not in ( $postMostViewed->ID, $postLessViewed->ID, $currentPost_id ) order by rand() limit 1"
);
if ($rand) {
$postRandViewed = get_post( $rand->ID );
}
?>
<div style="margin-bottom:40px">
<form class="d-flex input-group w-auto my-auto mb-3 mb-md-0" method="get" action="/index.php">
<input autocomplete="off" type="search" name="s" class="form-control rounded" placeholder="Szukaj..." />
<button class="input-group-text border-0 d-none d-lg-flex" type="submit"><i class="fas fa-search"></i></button>
</form>
</div>
<div style="margin-bottom:40px">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2401815550643539"
crossorigin="anonymous"></script>
<!-- Sidebar -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-2401815550643539"
data-ad-slot="6894360927"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
<div>
<h4>
Zobacz również
</h4>
<a href="<?php echo esc_url( get_permalink($postMostViewed->ID) ); ?>">
<?php echo get_the_post_thumbnail( $postMostViewed->ID, 'thumbnail', array( 'class' => 'alignleft' ) ); ?>
</a>
<p>
</p>
<a href="<?php echo esc_url( get_permalink($postLessViewed->ID) ); ?>">
<?php echo get_the_post_thumbnail( $postLessViewed->ID, 'thumbnail', array( 'class' => 'alignleft' ) ); ?>
</a>
<p>
</p>
<a href="<?php echo esc_url( get_permalink($postRandViewed->ID) ); ?>">
<?php echo get_the_post_thumbnail( $postRandViewed->ID, 'thumbnail', array( 'class' => 'alignleft' ) ); ?>
</a>
</div>
</div>

159
single.php Normal file
View File

@@ -0,0 +1,159 @@
<?php
/**
* Pojedynczy wpis
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.1
*/
get_header();
global $post;
global $wpdb;
$upload_dir = wp_upload_dir();
$image = $wpdb->get_row(
"SELECT * FROM {$wpdb->prefix}responsive_images where `img_filetype` in ('jpg', 'png') and `img_size` = 'hr' and `img_post_id` = " .
get_post_thumbnail_id($post->ID)
);
$webp = $wpdb->get_row(
"SELECT * FROM {$wpdb->prefix}responsive_images where `img_filetype` in ('webp') and `img_size` = 'hr' and `img_post_id` = " .
get_post_thumbnail_id($post->ID)
);
if (wp_is_mobile()) {
$image = $wpdb->get_row(
"SELECT * FROM {$wpdb->prefix}responsive_images where `img_filetype` in ('jpg', 'png') and `img_size` = 'hrmb' and `img_post_id` = " .
get_post_thumbnail_id($post->ID)
);
$webp = $wpdb->get_row(
"SELECT * FROM {$wpdb->prefix}responsive_images where `img_filetype` in ('webp') and `img_size` = 'hrmb' and `img_post_id` = " .
get_post_thumbnail_id($post->ID)
);
}
if (!empty($image)) {
$time = filemtime($upload_dir["basedir"] . $image->img_location);
}
if (!empty($webp)) {
$webpset = '"' . $upload_dir["baseurl"] . $image->img_location . '" type("image/webp"), ';
} else {
$webpset = "";
}
if (!empty($image)) {
$jpgpset = '"' . $upload_dir["baseurl"] . $image->img_location . '" type("image/jpg")';
?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php if(!wp_is_mobile()) { ?>
<div class="page-hero" style='background-image: linear-gradient(0deg, rgba(28,47,64,0.7),rgba(47,72,103,0.7)), url("<?php echo $upload_dir["baseurl"] . $webp->img_location; ?>?x=<?php echo $time ?>"); background-repeat: no-repeat; background-position: top; background-size: cover; height:585px'>
<div class="container col-lg-6 col-xs-12">
<div class="row" style="color:#fff">
<div style="padding-top: calc(18% + 190px)">
<h1 class="post-title text-center mb-5" ><?php the_title(); ?></h1>
<?php the_excerpt() ?>
<?php get_template_part('template-parts/content/content-meta'); ?>
</div>
</div>
</div>
</div>
<article class="container col-lg-8 col-xs-12 test4">
<?php } else { ?>
<div >
<div class="img-container" style='margin-top: 70px;'>
<figure class="wp-caption image">
<picture>
<source srcset="<?php echo $upload_dir["baseurl"] . $webp->img_location; ?>?x=<?php echo $time ?>" type="image/webp">
<source srcset="<?php echo $upload_dir["baseurl"] . $image->img_location ; ?>?x=<?php echo $time ?>" type="image/jpeg">
<img src="<?php echo $upload_dir["baseurl"] . $image->img_location; ?>?x=<?php echo $time ?>">
</picture>
</figure>
<div class="overlay">
<div class="text">
<div style="padding-top: 0px">
<h1 class="post-title text-center mb-5" ><?php the_title(); ?></h1>
<?php the_excerpt() ?>
<?php get_template_part('template-parts/content/content-meta-mb'); ?>
</div>
</div>
</div>
</div>
</div>
<article class="container col-lg-8 col-xs-12 test4">
<?php } ?>
<div class="row">
<div class="col-lg-8 col-xs-12">
<nav id="breadcrumbs" class="breadcrumbs mb-5"><?php echo Breadcrumbs::postBreadcrumbs() ?></nav>
<?php the_content(); ?>
</div>
<aside class="col-lg-4 col-xs-12"><?php get_sidebar(); ?></aside>
</div>
</article>
<?php endwhile; else:
get_template_part('template-parts/content/content-none');
endif;
} else {
?>
<main class="content" id="main">
<article class="container col-lg-6 col-xs-12 test2">
<div class="row">
<div>
<nav id="breadcrumbs" class="breadcrumbs mb-5"><?php echo Breadcrumbs::postBreadcrumbs() ?></nav>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2401815550643539"
crossorigin="anonymous">
</script>
<!-- Sidebar -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-2401815550643539"
data-ad-slot="6894360927"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_excerpt() ?>
<?php get_template_part('template-parts/content/content-meta'); ?>
<h1 class="post-title text-center mb-5"><?php the_title(); ?></h1>
<?php the_content(); ?>
</div>
<?php wp_link_pages(array('before' => '<p><strong>Strona:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
<?php endwhile; else:
get_template_part('template-parts/content/content-none');
endif; ?>
</div>
</div>
</article>
</main>
<?php
} ?>
<?php comments_template();
get_footer();

465
style.css Normal file
View File

@@ -0,0 +1,465 @@
@charset "UTF-8";
/*
Theme Name: TylkoFotografia.pl
Theme URI: https://krzysztof-turek.com
Author: Krzysztof Turek
Author URI: https://krzysztof-turek.com
*/
html, body {
height: 100%;
margin-top: 0;
}
/* body jako kontener flex, w kolumnie: nav + main + footer */
body {
display: flex;
flex-direction: column;
}
/* główna zawartość ma się rozpychać, żeby odepchnąć footer na dół */
main {
flex: 1 0 auto;
margin-top: 60px; /* to już masz przenosimy tutaj, żeby było w jednym miejscu */
}
/* stopka nie kurczy się i siedzi na dole, jeśli treści jest mało */
footer {
flex-shrink: 0;
margin-top: auto;
padding: 30px 0; /* to już masz u siebie możesz zostawić tu */
}
* {
margin: 0;
padding: 0;
font-family: 'Maven Pro', sans-serif;
font-display: swap;
}
img {
max-width: 100%;
height: auto;
}
a {
color: #6B7887;
text-decoration: none;
}
a:hover {
color: #9FADBD;
}
/* ======================== */
/* TYPOGRAFIA */
/* ======================== */
h1.logo, p.logo {
font-size: 28px;
color: #1C2F40;
margin-bottom: 0;
display: none !important;
}
h2 {}
/* ======================== */
/* NAWIGACJA */
/* ======================== */
.navbar {
border-radius: 0;
padding-right: 20px;
background: #fff;
opacity: 0.9;
}
.navbar-brand {
padding-top: 0;
padding-bottom: 0;
}
.navbar-light .navbar-nav .nav-link,
.navbar-light .navbar-brand {
color: #1C2F40;
}
.btn-outline-dark {
color: #1C2F40;
border-color: #1C2F40;
}
.btn-outline-dark:hover {
color: #fff;
background-color: #1C2F40;
border-color: #1C2F40;
}
@media (min-width: 992px) {
.navbar-expand-lg .navbar-nav .nav-link {
padding-left: 2rem;
}
/* ======================== */
/* TREŚĆ ARTYKUŁU */
/* ======================== */
article {
font-family: 'Helvetica', Arial, sans-serif;
font-size: 1rem;
line-height: 1.8;
color: #333;
text-align: justify;
margin: 20px auto;
padding: 20px;
max-width: 800px;
border-radius: 8px;
--box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
background-color: #fff;
}
article p {
margin-bottom: 1.5rem;
}
article a {
color: #1a73e8;
text-decoration: none;
border-bottom: 1px dotted #1a73e8;
transition: color 0.3s ease, border-bottom-color 0.3s ease;
}
article a:hover {
color: #0c47a1;
border-bottom-color: transparent;
}
article strong {
font-weight: bold;
}
article h2 {
font-size: 25px;
margin-top: 40px;
margin-bottom: 15px;
font-weight: bold;
}
article h3 {
padding-top: 30px;
padding-bottom: 15px;
font-size: 20px;
font-weight: bold;
}
article h4 {
padding-top: 15px;
padding-bottom: 15px;
font-size: 16px;
font-weight: bold;
}
article ul {
margin-left: 15px;
}
figure.aligncenter, .has-text-align-center, figcaption {
text-align: center;
}
figcaption {
font-style: italic;
}
.table {
margin-bottom: 2px;
}
/* ======================== */
/* OVERLAY IMAGE */
/* ======================== */
.img-container {
position: relative;
width: 100%;
max-width: 800px; /* Możesz dostosować */
margin: 0 auto;
}
.overlay {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 100%;
width: 100%;
opacity: 0;
transition: opacity 0.5s ease;
background-color: rgba(28, 47, 64, 0.9); /* Lekka przezroczystość */
}
.img-container:hover .overlay,
.img-container:active .overlay {
opacity: 0.9;
}
.overlay h2 {
color: #fff;
text-align: center;
margin-bottom: 20px;
font-weight: 600;
font-size: 2rem;
line-height: 1.3;
}
.text {
color: white;
font-size: 1.25rem;
position: absolute;
padding: 9px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
width: 90%; /* Dostosowanie szerokości do urządzeń mobilnych */
}
/* RESPONSYWNOŚĆ */
@media (max-width: 768px) {
.overlay h2 {
font-size: 1.5rem;
}
.text {
font-size: 1.25rem;
padding: 5px;
width: 95%;
}
.img-container:hover .overlay,
.img-container:active .overlay {
opacity: 0.9;
}
}
/* ======================== */
/* KOMENTARZE */
/* ======================== */
.comments-area {
margin-top: 60px;
}
/* ======================== */
/* SEARCH FORM */
/* ======================== */
.searchform {
margin: 30px 0;
}
/* ======================== */
/* NEWSLETTER */
/* ======================== */
.newsletter {
padding: 60px 0;
background: #e1faff;
}
.newsletter .content {
max-width: 650px;
margin: 0 auto;
text-align: center;
position: relative;
z-index: 2;
}
.newsletter .content h2 {
color: #1C2F40;
margin-bottom: 40px;
}
.newsletter .content .form-control {
height: 50px;
border-color: #ffffff;
border-radius: 0;
}
.newsletter .content .form-control:focus {
box-shadow: none;
border: 2px solid #1C2F40;
}
.newsletter .content .btn {
min-height: 50px;
border-radius: 0;
background: #1C2F40;
color: #fff;
font-weight: 600;
}
/* ======================== */
/* FOOTER */
/* ======================== */
footer {
padding: 30px 0;
}
.footer {
background: #1C2F40;
color: #fff;
}
footer a {
color: #fff;
text-decoration: none;
}
footer a:hover {
text-decoration: underline;
}
/* ======================== */
/* TABLE OF CONTENTS */
/* ======================== */
.table-of-contents {
background: #e1faff;
border: 1px solid #aaa;
font-size: 85%;
padding: 20px;
margin: 5px;
width: 100%;
overflow: hidden;
transition: width 2s;
}
.table-of-contents:hover {
width: auto;
}
/* ======================== */
/* KARTY I ELEMENTY */
/* ======================== */
.card {
margin-bottom: 10px;
border-radius: 10px;
}
.custom-card-header {
background-color: #1C2F40;
border-radius: 10px 10px 0 0;
}
.custom-card-title {
color: #fff;
padding-left: 10px;
margin: 10px 0;
font-weight: bold;
}
.custom-card-body nav {
margin-top: 5px;
margin-left: 5px;
}
/* ======================== */
/* RESPONSYWNOŚĆ */
/* ======================== */
@media (max-width: 992px) {
.overlay h2 {
font-size: 18px;
}
.text {
font-size: 12px;
padding: 7px;
}
.table-of-contents {
font-size: 95%;
margin-right: 20px;
margin-bottom: 10px;
}
.btn-primary {
min-height: 40px;
border-radius: 4px;
background: #1C2F40;
color: #fff;
}
.btn-primary:hover {
background: #2E506D;
}
article {
padding: 15px;
}
}
/* Kontener artykułu */
.content-card {
display: flex;
flex-direction: column;
justify-content: space-between;
height: 100%;
border: 1px solid #ccc;
padding: 10px;
box-sizing: border-box;
}
/* Obrazek */
.content-card figure {
margin: 0;
}
.content-card img {
/*width: 100%;*/
height: auto;
}
/* Sekcja tekstowa */
.content-details {
display: flex;
flex-direction: column;
justify-content: space-between;
flex-grow: 1;
}
.content-details p {
margin: 0 0 10px 0;
}
.more-link {
margin-top: auto;
}
.content-details hr {
margin: 10px 0 0 0;
border: none;
border-top: 1px solid #ccc;
}
/* Równe wysokości dla kolumn */
@media (min-width: 768px) {
.content-wrapper {
display: flex;
gap: 20px;
}
.content-card {
width: 100%;
}
}

BIN
template-parts/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,15 @@
<?php
/**
* Szablon metadanych posta
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.1
*/
?>
<p class="heading-meta-mb"><b><?php
echo get_the_author() . "</b>";
echo " &#8226; <time>" . get_the_date() . "</time>";
?></p>

View File

@@ -0,0 +1,15 @@
<?php
/**
* Szablon metadanych posta
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.1
*/
?>
<p class="heading-meta"><b><?php
echo get_the_author() . "</b>";
echo " &#8226; <time>" . get_the_date() . "</time>";
?></p>

View File

@@ -0,0 +1,17 @@
<?php
/**
* Szablon braku wyników wyszukiwania
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.2
*/
if ( is_search() ) {
echo 'Niestety niczego nie znaleziono';
get_search_form();
} else {
echo 'Niestety niczego nie znaleziono';
get_search_form();
}

View File

@@ -0,0 +1,38 @@
<?php
/**
* Szablon stopki
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.2
*/
$defaults = [
"container" => "",
"container_class" => "",
"menu_class" => "",
"echo" => true,
"fallback_cb" => "wp_page_menu",
"items_wrap" => '<ul class="nav navbar-nav">%3$s</ul>',
"depth" => 0,
]; ?>
<footer class="content footer">
<div class="container">
<div class="row">
<div class="col-md-4">
<a href="<?php echo site_url(); ?>" class="navbar-brand">
<h2 class="logo">Tylko<b>Fotografia</b></h2></a>
</div>
<div class="col-md-4">
<p class="text-center"><i class="far fa-copyright"></i> Copyright 2025 <a href="<?php echo site_url(); ?>/kontakt/">Tylko<b>Fotografia</b></a></p>
<p class="text-center"><a href="<?php echo site_url(); ?>/polityka-prywatnosci/">Polityka prywatności</a></p>
</div>
<div class="col-md-2"></div>
<div class="col-md-2">
<?php wp_nav_menu($defaults); ?>
</div>
</div>
</div>
</footer>

View File

@@ -0,0 +1,30 @@
<?php
/**
* Szablon obrazka nagłówka
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.2
*/
global $wpdb;
$upload_dir = wp_upload_dir();
if (!wp_is_mobile() && has_header_image()) {
?><div class="content" id="banner">
<?php
if (function_exists('getResponsiveImage')) {
$data = get_object_vars(get_theme_mod('header_image_data'));
$attachment_id = is_array($data) && isset($data['attachment_id']) ? $data['attachment_id'] : false;
if($attachment_id && is_front_page () && is_home ()) {
$webp2x = $wpdb->get_row( "SELECT * FROM {$wpdb->prefix}responsive_images where `img_filetype` in ('webp') and `img_size` = '2x' and `img_post_id` = " . $attachment_id);
$webp1x = $wpdb->get_row( "SELECT * FROM {$wpdb->prefix}responsive_images where `img_filetype` in ('webp') and `img_size` = '1x' and `img_post_id` = " . $attachment_id);
//echo getResponsiveImage( ['id' => $attachment_id, 'align' => '', 'caption' => ''] );
?><div style='background-image: -webkit-image-set( url("<?php echo $upload_dir["baseurl"] . $webp1x->img_location; ?>?x=5") 1x, url("<?php echo $upload_dir["baseurl"] . $webp2x->img_location; ?>?x=5") 2x); background-repeat: no-repeat; background-position: top; background-size: cover; height:353px; margin-bottom: 20px;'>
</div>
<?php } } else {
?><img src="<?php echo get_header_image() ; ?>" alt="<?php echo esc_attr( get_bloginfo( 'title' ) ); ?>" />
<?php } ?>
</div>
<?php }

View File

@@ -0,0 +1,112 @@
<?php
/**
* Szablon nawigacji
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.2
*/
$menu = new Menus();
$menuId = $menu->get_menu_id( 'tf-header-menu' );
$headerMenu = wp_get_nav_menu_items( $menuId );
$main = '';
$directory_uri = get_stylesheet_directory_uri();
?>
<!-- Jumbotron -->
<!---<div class="text-center ">
<div class="container">
<div class="row">
<div class="col-md-4 d-flex justify-content-center justify-content-md-start mb-3 mb-md-0">
<a class="navbar-brand" href="<?php echo site_url(); ?>">
<?php if ( is_home() && is_front_page() ) { ?>
<h1 class="logo" id="logo">Tylko<b>Fotografia</b></h1>
<?php } else { ?>
<p class="logo" id="logo">Tylko<b>Fotografia</b></p>
<?php } ?>
</a>
</div>
<div class="col-md-5">
</div>
<div class="col-md-3">
<form class="d-flex input-group w-auto my-auto mb-3 mb-md-0" method="get" action="/index.php">
<input autocomplete="off" type="search" name="s" class="form-control rounded" placeholder="Szukaj" />
<button class="input-group-text border-0 d-none d-lg-flex" type="submit"><i class="fas fa-search"></i></button>
</form>
</div>
</div>
</div>
</div>--->
<!-- Jumbotron -->
<!-- navbar navbar-expand-md navbar-dark fixed-top rozszerza do góry -->
<nav class="navbar navbar-expand-lg fixed-top navbar-light ">
<div class="container">
<a class="navbar-brand" href="<?php echo site_url(); ?>">
<img src="<?php echo $directory_uri; ?>/favicon/TylkoFotografia-logo-icon.png" style="display: inline-block; vertical-align: middle; max-height: 40px; margin-right: 5px;"/>
<?php if ( is_home() && is_front_page() ) { ?>
<h1 class="logo" id="logo" style="display: inline-block;
vertical-align: middle;">Tylko<b>Fotografia</b></h1>
<?php } else { ?>
<p class="logo" id="logo" style="display: inline-block;
vertical-align: middle;">Tylko<b>Fotografia</b></p>
<?php } ?>
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mx-auto mb-2 mb-lg-0 ml-2">
<?php
if (is_array($headerMenu) || is_object($headerMenu))
{
foreach($headerMenu as $menuItem)
{
$childItems = $menu->get_child_menu_items( $headerMenu, $menuItem->ID );
if ($menuItem->menu_item_parent == 0 && empty($childItems)) {
$main .= '<li class="nav-item">';
$main .= '<a href="'.$menuItem->url.'" class="nav-link">'.$menuItem->title.'</a>';
$main .= '</li>';
}
if ($menuItem->menu_item_parent == 0 && !empty($childItems))
{
$main .= '<li class="nav-item dropdown">';
$main .= '<a href="#" class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">'.$menuItem->title.'</a>';
if (!empty($childItems) && is_array($childItems) )
{
$main .= '<ul class="dropdown-menu">';
foreach ($childItems as $childItem)
{
$main .= '<li>';
$main .= '<a href="'.$childItem->url.'" class="dropdown-item ">'.$childItem->title.'</a>';
$main .= '</li>';
}
$main .= '</ul>';
}
$main .= '</li>';
}
}
}
echo $main;
?>
</ul>
<form class="d-flex input-group w-auto my-auto mb-3 mb-md-0" method="get" action="/index.php">
<input autocomplete="off" type="search" name="s" class="form-control rounded" placeholder="Szukaj" />
<button class="input-group-text border-0 d-none d-lg-flex" type="submit"><i class="fas fa-search"></i></button>
</form>
</div>
</div>
</nav>

View File

@@ -0,0 +1,33 @@
<?php
/**
* Szablon stopki newslettera
* Wymagany https://pl.wordpress.org/plugins/newsletter/
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.1
*/
?>
<section class="newsletter">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="content">
<h2>Zapisz się do newslettera</h2>
<form form data-v-291e79e2="" action="https://api.follow.it/subscription-form/c0xPS0R4dTZsbGhxaHNocFZtQUFHTENSVllTYkEzVW5LQldZMmZVVjZOQnN2bExVQ3locnVLQm1RVHBEYmhBSnBVd0dGN2hrSFhXMjQ4VFBrdUpmbFBlMEhBTmVSazEzK3pIcDAxa2ZPdS9VYkRLVVBXZnlVbkxFUjBZRzk4YnZ8RnN1T1JKck50bXV0ZmFMOGFiU1BBbmFtaUlxN2lWeWhOVlBkL3RxemRmTT0=/8" method="post">
<div class="input-group">
<input class="form-control" data-v-291e79e2="" type="email" name="email" required="required" placeholder="Podaj adres email" spellcheck="false" >
<span class="input-group-btn">
<button class="btn" type="submit"><i class="far fa-envelope"></i> Zapisz mnie</button>
</span>
</div>
</form>
<small>Zapisując się do newslettera, akceptujesz politykę prywatności</small>
<p id="result"></p>
</div>
</div>
</div>
</div>
</section>

BIN
webfonts/fa-brands-400.ttf Normal file

Binary file not shown.

Binary file not shown.

BIN
webfonts/fa-regular-400.ttf Normal file

Binary file not shown.

Binary file not shown.

BIN
webfonts/fa-solid-900.ttf Normal file

Binary file not shown.

BIN
webfonts/fa-solid-900.woff2 Normal file

Binary file not shown.