add template

This commit is contained in:
Chloe Listrat 2020-05-20 15:58:33 +02:00
parent cf7a95d818
commit c602563e67
85 changed files with 36637 additions and 375 deletions

View File

@ -40,7 +40,6 @@
"roots/wp-password-bcrypt": "1.0.0",
"wpackagist-plugin/advanced-custom-fields": "^5.8",
"wpackagist-plugin/classic-editor": "^1.5",
"timber/timber": "^1.15",
"wpackagist-plugin/timber-library": "^1.15"
},
"require-dev": {

366
composer.lock generated
View File

@ -4,118 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "c3e60299c5808b46824d8d7d6cfee013",
"content-hash": "c9f965460c155a0284ce16cb52122a10",
"packages": [
{
"name": "altorouter/altorouter",
"version": "v1.2.0",
"source": {
"type": "git",
"url": "https://github.com/dannyvankooten/AltoRouter.git",
"reference": "39c50092470128c12284d332bb57f306bb5b58e4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dannyvankooten/AltoRouter/zipball/39c50092470128c12284d332bb57f306bb5b58e4",
"reference": "39c50092470128c12284d332bb57f306bb5b58e4",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"codeclimate/php-test-reporter": "dev-master",
"phpunit/phpunit": "4.5.*"
},
"type": "library",
"autoload": {
"classmap": [
"AltoRouter.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Danny van Kooten",
"email": "dannyvankooten@gmail.com",
"homepage": "http://dannyvankooten.com/"
},
{
"name": "Koen Punt",
"homepage": "https://github.com/koenpunt"
},
{
"name": "niahoo",
"homepage": "https://github.com/niahoo"
}
],
"description": "A lightning fast router for PHP",
"homepage": "https://github.com/dannyvankooten/AltoRouter",
"keywords": [
"lightweight",
"router",
"routing"
],
"time": "2015-11-30T00:47:43+00:00"
},
{
"name": "asm89/twig-cache-extension",
"version": "1.4.0",
"source": {
"type": "git",
"url": "https://github.com/asm89/twig-cache-extension.git",
"reference": "13787226956ec766f4770722082288097aebaaf3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/asm89/twig-cache-extension/zipball/13787226956ec766f4770722082288097aebaaf3",
"reference": "13787226956ec766f4770722082288097aebaaf3",
"shasum": ""
},
"require": {
"php": ">=5.3.2",
"twig/twig": "^1.0|^2.0"
},
"require-dev": {
"doctrine/cache": "~1.0",
"phpunit/phpunit": "^5.0 || ^4.8.10"
},
"suggest": {
"psr/cache-implementation": "To make use of PSR-6 cache implementation via PsrCacheAdapter."
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
}
},
"autoload": {
"psr-4": {
"": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Alexander",
"email": "iam.asm89@gmail.com"
}
],
"description": "Cache fragments of templates directly within Twig.",
"homepage": "https://github.com/asm89/twig-cache-extension",
"keywords": [
"cache",
"extension",
"twig"
],
"time": "2020-01-01T20:47:37+00:00"
},
{
"name": "composer/installers",
"version": "v1.9.0",
@ -605,260 +495,6 @@
],
"time": "2020-05-12T16:14:59+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.17.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "fa79b11539418b02fc5e1897267673ba2c19419c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fa79b11539418b02fc5e1897267673ba2c19419c",
"reference": "fa79b11539418b02fc5e1897267673ba2c19419c",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-mbstring": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.17-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Mbstring\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for the Mbstring extension",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"mbstring",
"polyfill",
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-12T16:47:27+00:00"
},
{
"name": "timber/timber",
"version": "1.15.2",
"source": {
"type": "git",
"url": "https://github.com/timber/timber.git",
"reference": "c0856786f5f2bb9bbcca9febc1ae8998d912734b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/timber/timber/zipball/c0856786f5f2bb9bbcca9febc1ae8998d912734b",
"reference": "c0856786f5f2bb9bbcca9febc1ae8998d912734b",
"shasum": ""
},
"require": {
"asm89/twig-cache-extension": "~1.0",
"composer/installers": "~1.0",
"php": ">=5.3.0|7.*",
"twig/twig": "^1.41|^2.10",
"upstatement/routes": "0.5"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
"johnpbloch/wordpress": "*",
"phpunit/phpunit": "5.7.16|6.*",
"squizlabs/php_codesniffer": "3.*",
"wp-coding-standards/wpcs": "^2.0",
"wpackagist-plugin/advanced-custom-fields": "5.*",
"wpackagist-plugin/co-authors-plus": "3.2.*"
},
"suggest": {
"satooshi/php-coveralls": "1.0.* for code coverage"
},
"type": "library",
"autoload": {
"psr-4": {
"Timber\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jared Novack",
"email": "jared@upstatement.com",
"homepage": "http://upstatement.com"
},
{
"name": "Connor J. Burton",
"email": "connorjburton@gmail.com",
"homepage": "http://connorburton.com"
}
],
"description": "Plugin to write WordPress themes w Object-Oriented Code and the Twig Template Engine",
"homepage": "http://timber.upstatement.com",
"keywords": [
"templating",
"themes",
"timber",
"twig"
],
"time": "2020-03-24T17:38:21+00:00"
},
{
"name": "twig/twig",
"version": "v2.12.5",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "18772e0190734944277ee97a02a9a6c6555fcd94"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/18772e0190734944277ee97a02a9a6c6555fcd94",
"reference": "18772e0190734944277ee97a02a9a6c6555fcd94",
"shasum": ""
},
"require": {
"php": "^7.0",
"symfony/polyfill-ctype": "^1.8",
"symfony/polyfill-mbstring": "^1.3"
},
"require-dev": {
"psr/container": "^1.0",
"symfony/phpunit-bridge": "^4.4|^5.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.12-dev"
}
},
"autoload": {
"psr-0": {
"Twig_": "lib/"
},
"psr-4": {
"Twig\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com",
"homepage": "http://fabien.potencier.org",
"role": "Lead Developer"
},
{
"name": "Twig Team",
"role": "Contributors"
},
{
"name": "Armin Ronacher",
"email": "armin.ronacher@active-4.com",
"role": "Project Founder"
}
],
"description": "Twig, the flexible, fast, and secure template language for PHP",
"homepage": "https://twig.symfony.com",
"keywords": [
"templating"
],
"time": "2020-02-11T15:31:23+00:00"
},
{
"name": "upstatement/routes",
"version": "0.5",
"source": {
"type": "git",
"url": "https://github.com/Upstatement/routes.git",
"reference": "3267d28be0a73f197087d58384e1a358d85671b6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Upstatement/routes/zipball/3267d28be0a73f197087d58384e1a358d85671b6",
"reference": "3267d28be0a73f197087d58384e1a358d85671b6",
"shasum": ""
},
"require": {
"altorouter/altorouter": "^1.1.0",
"composer/installers": "~1.0",
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "3.7.*",
"satooshi/php-coveralls": "dev-master",
"wp-cli/wp-cli": "*"
},
"type": "library",
"autoload": {
"psr-0": {
"Routes": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jared Novack",
"email": "jared@upstatement.com",
"homepage": "http://upstatement.com"
}
],
"description": "Manage rewrites and routes in WordPress with this dead-simple plugin",
"homepage": "http://routes.upstatement.com",
"keywords": [
"redirects",
"rewrite",
"routes",
"routing"
],
"time": "2018-12-04T01:13:41+00:00"
},
{
"name": "vlucas/phpdotenv",
"version": "v4.1.5",

View File

@ -0,0 +1,12 @@
{
"extends": [
"stylelint-config-wordpress"
],
"plugins": ["stylelint-a11y"],
"rules": {
"font-family-no-missing-generic-family-keyword": null,
"no-descending-specificity": null,
"a11y/no-outline-none": true,
"a11y/selector-pseudo-class-focus": true
}
}

View File

@ -0,0 +1,36 @@
<?php
/**
* The template for displaying the 404 template in the Twenty Twenty theme.
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
get_header();
?>
<main id="site-content" role="main">
<div class="section-inner thin error404-content">
<h1 class="entry-title"><?php _e( 'Page Not Found', 'twentytwenty' ); ?></h1>
<div class="intro-text"><p><?php _e( 'The page you were looking for could not be found. It might have been removed, renamed, or did not exist in the first place.', 'twentytwenty' ); ?></p></div>
<?php
get_search_form(
array(
'label' => __( '404 not found', 'twentytwenty' ),
)
);
?>
</div><!-- .section-inner -->
</main><!-- #site-content -->
<?php get_template_part( 'template-parts/footer-menus-widgets' ); ?>
<?php
get_footer();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,600 @@
/* -------------------------------------------------------------------------- */
/* Twenty Twenty Editor Styles Classic Editor
/* -------------------------------------------------------------------------- */
/* Fonts ------------------------------------- */
/*
* Chrome renders extra-wide &nbsp; characters for the Hoefler Text font.
* This results in a jumping cursor when typing in both the classic editor and
* block editor. The following font-face override fixes the issue by manually
* inserting a custom font that includes just a Hoefler Text space replacement
* for that character instead.
*/
@font-face {
font-family: NonBreakingSpaceOverride;
src: url(data:application/font-woff2;charset=utf-8;base64,d09GMgABAAAAAAMoAA0AAAAACDQAAALTAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP0ZGVE0cGh4GYACCahEICjx3CywAATYCJANUBCAFhiEHgWwbXQfILgpsY+rQRRARwyAs6uL7pxzYhxEE+32b3aeHmifR6tklkS9hiZA0ewkqGRJE+H7/+6378ASViK/PGeavqJyOzsceKi1s3BCiQsiOdn1r/RBgIJYEgCUhbm/8/8/h4saPssnTNkkiWUBrTRtjmQSajw3Ui3pZ3LYDPD+XG2C3JA/yKAS8/rU5eNfuGqRf4eNNgV4YAlIIgxglEkWe6FYpq10+wi3g+/nUgvgPFczNrz/RsTgVm/zfbPuHZlsuQECxuyqBcQwKFBjFgKO8AqP4bAN9tFJtnM9xPcbNjeXS/x1wY/xU52f5W/X1+9cnH4YwKIaoRRAkUkj/YlAAeF/624foiIDBgBmgQBeGAyhBljUPZUm/l2dTvmpqcBDUOHdbPZWd8JsBAsGr4w8/EDn82/bUPx4eh0YNrQTBuHO2FjQEAGBwK0DeI37DpQVqdERS4gZBhpeUhWCfLFz7J99aEBgsJCHvUGAdAPp4IADDCAPCEFMGpMZ9AQpTfQtQGhLbGVBZFV8BaqNyP68oTZgHNj3M8kBPfXTTC9t90UuzYhy9ciH0grVlOcqyCytisvbsERsEYztiznR0WCrmTksJwbSNK6fd1Rvr25I9oLvctUoEbNOmXJbqgYgPXEHJ82IUsrCnpkxh23F1rfZ2zcRnJYoXtauB3VTFkFXQg3uoZYD5qE0kdjDtoDoF1h2bulGmev5HbYhbrjtohQSRI4aNOkffIcT+d3v6atpaYh3JvPoQsztCcqvaBkppDSPcQ3bw3KaCBo1f5CJWTZEgW3LjLofYg51MaVezrx8xZitYbQ9KYeoRaqQdVLwSEfrKXLK1otCWOKNdR/YwYAfon5Yk8O2MJfSD10dPGA5PIJJQMkah0ugMJiv6x4Dm7LEa8xnrRGGGLAg4sAlbsA07sAt76DOsXKO3hIjtIlpnnFrt1qW4kh6NhS83P/6HB/fl1SMAAA==) format("woff2"), url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUQAA0AAAAACDQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAE9AAAABwAAAAchf5yU0dERUYAAATYAAAAHAAAAB4AJwAbT1MvMgAAAaAAAABJAAAAYJAcgU5jbWFwAAACIAAAAF4AAAFqUUxBZ2dhc3AAAATQAAAACAAAAAgAAAAQZ2x5ZgAAApAAAAAyAAAAPL0n8y9oZWFkAAABMAAAADAAAAA2Fi93Z2hoZWEAAAFgAAAAHQAAACQOSgWaaG10eAAAAewAAAAzAAAAVC7TAQBsb2NhAAACgAAAABAAAAAsAOQBAm1heHAAAAGAAAAAHQAAACAAWQALbmFtZQAAAsQAAAF6AAADIYvD/Adwb3N0AAAEQAAAAI4AAADsapk2o3jaY2BkYGAA4ov5mwzj+W2+MnCzXwCKMNzgCBSB0LfbQDQ7AxuI4mBgAlEAFKQIRHjaY2BkYGD3+NvCwMDBAALsDAyMDKhAFAA3+wH3AAAAeNpjYGRgYBBl4GBgYgABEMnIABJzAPMZAAVmAGUAAAB42mNgZlJhnMDAysDCKsKygYGBYRqEZtrDYMT4D8gHSmEHjgUFOQwODAqqf9g9/rYwMLB7MNUAhRlBcsxBrMlASoGBEQAj8QtyAAAAeNrjYGBkAAGmWQwMjO8gmBnIZ2NA0ExAzNjAAFYJVn0ASBsD6VAIDZb7AtELAgANIgb9AHjaY2BgYGaAYBkGRgYQSAHyGMF8FgYPIM3HwMHAxMDGoMCwQIFLQV8hXvXP//9AcRCfAcb///h/ygPW+w/vb7olBjUHCTCyMcAFGZmABBO6AogThgZgIUsXAEDcEzcAAHjaY2BgECMCyoEgACZaAed42mNgYmRgYGBnYGNgYAZSDJqMgorCgoqCjECRXwwNrCAKSP5mAAFGBiRgyAAAi/YFBQAAeNqtkc1OwkAUhU/5M25cEhcsZick0AwlBJq6MWwgJkAgYV/KAA2lJeUn+hY+gktXvpKv4dLTMqKycGHsTZNv7px7z50ZAFd4hYHjdw1Ls4EiHjVncIFnzVnc4F1zDkWjrzmPW+NNcwGlzIRKI3fJlUyrEjZQxb3mDH2fNGfRx4vmHKqG0JzHg6E0F9DOlFBGBxUI1GEzLNT4S0aLuTtsGAEUuYcQHkyg3KmIum1bNUvKlrjbbAIleqHHnS4iSudpQcySMYtdFiXlAxzSbAwfMxK6kZoHKhbjjespMTioOPZnzI+4ucCeTVyKMVKLfeAS6vSWaTinuZwzyy/Dc7vaed+6KaV0kukdPUk6yOcctZPvvxxqksq2lEW8RvHjMEO2FCl/zy6p3NEm0R9OFSafJdldc4QVeyaaObMBO0/5cCaa6d9Ggyubxire+lEojscdjoWUR1xGOy8KD8mG2ZLO2l2paDc3A39qmU2z2W5YNv5+u79e6QfGJY/hAAB42m3NywrCMBQE0DupWp/1AYI7/6DEaLQu66Mrd35BKUWKJSlFv1+rue4cGM7shgR981qSon+ZNwUJ8iDgoYU2OvDRRQ99DDDECAHGmGCKmf80hZSx/Kik/LliFbtmN6xmt+yOjdg9GztV4tROnRwX/Bsaaw51nt4Lc7tWaZYHp/MlzKx51LZs5htNri+2AAAAAQAB//8AD3jaY2BkYGDgAWIxIGZiYARCESBmAfMYAAR6AEMAAAABAAAAANXtRbgAAAAA2AhRFAAAAADYCNuG) format("woff");
}
/* ----------------------------------------------
Inter variable font. Usage:
@supports (font-variation-settings: normal) {
html { font-family: "Inter var", sans-serif; }
}
---------------------------------------------- */
@font-face {
font-family: "Inter var";
font-weight: 100 900; /* stylelint-disable-line font-weight-notation */
font-style: normal;
src: url(../fonts/inter/Inter-upright-var.woff2) format("woff2");
}
@font-face {
font-family: "Inter var";
font-weight: 100 900; /* stylelint-disable-line font-weight-notation */
font-style: italic;
src: url(../fonts/inter/Inter-italic-var.woff2) format("woff2");
}
/* Structure --------------------------------- */
body#tinymce.wp-editor.content { /* stylelint-disable-line no-duplicate-selectors */
font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, sans-serif;
}
@supports ( font-variation-settings: normal ) {
body#tinymce.wp-editor.content { /* stylelint-disable-line no-duplicate-selectors */
font-family: "Inter var", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, sans-serif;
}
}
body#tinymce.wp-editor.content { /* stylelint-disable-line no-duplicate-selectors */
background: #f5efe0;
color: #000;
font-size: 21px;
letter-spacing: -0.015em;
margin: 0 auto;
max-width: calc(100% - 40px);
width: 580px;
}
body#tinymce.wp-editor.content * {
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
}
body#tinymce.wp-editor.content p,
body#tinymce.wp-editor.content ol,
body#tinymce.wp-editor.content ul,
body#tinymce.wp-editor.content dl,
body#tinymce.wp-editor.content dt {
font-family: NonBreakingSpaceOverride, "Hoefler Text", Garamond, "Times New Roman", serif;
letter-spacing: normal;
}
body#tinymce.wp-editor.content p,
body#tinymce.wp-editor.content ul,
body#tinymce.wp-editor.content ol,
body#tinymce.wp-editor.content blockquote {
line-height: 1.5;
margin-bottom: 1.5em;
}
body#tinymce.wp-editor.content code,
body#tinymce.wp-editor.content kbd,
body#tinymce.wp-editor.content samp {
background: rgba(0, 0, 0, 0.075);
}
body#tinymce.wp-editor.content code,
body#tinymce.wp-editor.content kbd,
body#tinymce.wp-editor.content pre,
body#tinymce.wp-editor.content samp {
font-family: monospace;
color: inherit;
font-size: 15px;
}
body#tinymce.wp-editor.content pre {
border: 1px solid #dcd7ca;
line-height: 1.5;
margin: 40px 0;
overflow: auto;
padding: 30px;
text-align: right;
}
body#tinymce.wp-editor.content a,
body#tinymce.wp-editor.content a:focus,
body#tinymce.wp-editor.content a:hover {
color: #cd2653;
text-decoration: underline;
}
body#tinymce.wp-editor.content img {
height: auto;
max-width: 100%;
}
body#tinymce.wp-editor.content img[data-wp-more] {
height: 16px;
}
body#tinymce.wp-editor.content hr {
border: none;
border-top: 1px solid #dcd7ca;
margin: 2em auto;
width: 100%;
}
body#tinymce.wp-editor.content hr:not(.is-style-dots) {
background: linear-gradient(to right, currentColor calc(50% - 16px), transparent calc(50% - 16px), transparent calc(50% + 16px), currentColor calc(50% + 16px));
border: none;
color: #6d6d6d;
height: 1px;
margin: 80px 0;
overflow: visible;
position: relative;
}
body#tinymce.wp-editor.content hr:not(.is-style-dots)::before,
body#tinymce.wp-editor.content hr:not(.is-style-dots)::after {
background: currentColor;
content: "";
display: block;
height: 16px;
position: absolute;
top: calc(50% - 8px);
transform: rotate(-22.5deg);
width: 1px;
}
body#tinymce.wp-editor.content hr::before {
right: calc(50% - 5px);
}
body#tinymce.wp-editor.content hr::after {
left: calc(50% - 5px);
}
body#tinymce.wp-editor.content dt {
font-weight: 600;
}
body#tinymce.wp-editor.content dd {
line-height: 1.5;
}
body#tinymce.wp-editor.content dd + dt {
margin-top: 1.5rem;
}
/* Font Families ----------------------------- */
body#tinymce.wp-editor.content figcaption,
body#tinymce.wp-editor.content .wp-caption-text,
body#tinymce.wp-editor.content .wp-caption-dd,
body#tinymce.wp-editor.content cite,
body#tinymce.wp-editor.content table {
font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, sans-serif;
line-height: 1;
}
@supports ( font-variation-settings: normal ) {
body#tinymce.wp-editor.content figcaption,
body#tinymce.wp-editor.content .wp-caption-text,
body#tinymce.wp-editor.content .wp-caption-dd,
body#tinymce.wp-editor.content cite,
body#tinymce.wp-editor.content table {
font-family: "Inter var", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, sans-serif;
}
}
/* Titles ------------------------------------ */
body#tinymce.wp-editor.content h1,
body#tinymce.wp-editor.content h2,
body#tinymce.wp-editor.content h3,
body#tinymce.wp-editor.content h4,
body#tinymce.wp-editor.content h5,
body#tinymce.wp-editor.content h6 {
font-feature-settings: "lnum";
font-variant-numeric: lining-nums;
font-weight: 700;
letter-spacing: -0.0415625em;
line-height: 1.25;
margin: 40px 0 25px;
}
body#tinymce.wp-editor.content h1 {
font-size: 84px;
font-weight: 800;
line-height: 1.138888889;
}
body#tinymce.wp-editor.content h2 {
font-size: 48px;
}
body#tinymce.wp-editor.content h3 {
font-size: 40px;
}
body#tinymce.wp-editor.content h4 {
font-size: 32px;
}
body#tinymce.wp-editor.content h5 {
font-size: 24px;
}
body#tinymce.wp-editor.content h6 {
font-size: 18px;
letter-spacing: 0.03125em;
text-transform: uppercase;
}
/* Blockquote -------------------------------- */
body#tinymce.wp-editor.content blockquote {
border: none;
border-right: 2px solid #cd2653;
margin: 0 0 1.6em 0;
padding: 0.25em 1em 0.25em 0;
}
body#tinymce.wp-editor.content blockquote p {
font-style: normal;
font-weight: 400;
margin: 0;
}
body#tinymce.wp-editor.content cite {
color: #6d6d6d;
font-size: 16px;
font-weight: 500;
font-style: normal;
}
body#tinymce.wp-editor.content blockquote cite {
display: block;
margin-top: 20px;
}
/* Lists ------------------------------------- */
body#tinymce.wp-editor.content ul {
margin-right: 1.5em;
padding-right: 0;
list-style: disc;
}
body#tinymce.wp-editor.content ol {
margin-right: 1.5em;
padding-right: 0;
list-style: square;
}
body#tinymce.wp-editor.content ul ul {
list-style: circle;
}
body#tinymce.wp-editor.content ul ul ul {
list-style: square;
}
body#tinymce.wp-editor.content ol ol {
list-style: lower-alpha;
}
body#tinymce.wp-editor.content ol ol ol {
list-style: lower-roman;
}
body#tinymce.wp-editor.content ul ul,
body#tinymce.wp-editor.content ul ol,
body#tinymce.wp-editor.content ol ul,
body#tinymce.wp-editor.content ol ol {
margin-bottom: 0;
}
body#tinymce.wp-editor.content li {
line-height: 1.5;
margin-bottom: 0.5em;
}
body#tinymce.wp-editor.content ol > li:last-child,
body#tinymce.wp-editor.content ul > li:last-child {
margin-bottom: 0;
}
body#tinymce.wp-editor.content ol > li:first-child,
body#tinymce.wp-editor.content ul > li:first-child {
margin-top: 0.5em;
}
/* Post Media -------------------------------- */
body#tinymce.wp-editor.content figure,
body#tinymce.wp-editor.content video {
display: block;
margin: 0;
}
body#tinymce.wp-editor.content .wp-caption {
margin-bottom: 1.5em;
}
body#tinymce.wp-editor.content img.alignleft,
body#tinymce.wp-editor.content .alignleft img,
body#tinymce.wp-editor.content img.aligncenter,
body#tinymce.wp-editor.content .aligncenter img,
body#tinymce.wp-editor.content img.alignright,
body#tinymce.wp-editor.content .alignright img,
body#tinymce.wp-editor.content img.alignnone,
body#tinymce.wp-editor.content .alignnone img {
display: block;
}
body#tinymce.wp-editor.content .aligncenter,
body#tinymce.wp-editor.content .alignnone,
body#tinymce.wp-editor.content .alignwide,
body#tinymce.wp-editor.content .alignfull {
margin: 50px auto;
}
body#tinymce.wp-editor.content .alignleft,
body#tinymce.wp-editor.content .alignright {
margin-bottom: 25px;
max-width: 50%;
}
body#tinymce.wp-editor.content .wp-caption img {
display: block;
}
body#tinymce.wp-editor.content .wp-caption .alignleft,
body#tinymce.wp-editor.content .wp-caption .alignright {
margin-bottom: 0;
}
body#tinymce.wp-editor.content .alignleft {
float: left;
margin-left: 25px;
max-width: 260px;
}
body#tinymce.wp-editor.content .alignright {
float: right;
margin-right: 25px;
max-width: 260px;
}
body#tinymce.wp-editor.content .wpview[data-wpview-type="gallery"] + .wpview[data-wpview-type="gallery"] {
margin-top: -34px;
}
body#tinymce.wp-editor.content figcaption,
body#tinymce.wp-editor.content .wp-caption-text,
body#tinymce.wp-editor.content .wp-caption-dd,
body#tinymce.wp-editor.content .gallery-caption {
color: #6d6d6d;
display: block;
font-size: 15px;
font-weight: 500;
line-height: 1.2;
margin: 18px 0 0;
}
body#tinymce.wp-editor.content figcaption a,
body#tinymce.wp-editor.content .wp-caption-text a,
body#tinymce.wp-editor.content .wp-caption-dd a,
body#tinymce.wp-editor.content .gallery-caption a {
color: inherit;
}
/* Tables ------------------------------------ */
body#tinymce.wp-editor.content table {
border-collapse: collapse;
border-spacing: 0;
empty-cells: show;
font-size: 18px;
width: 100%;
}
body#tinymce.wp-editor.content th,
body#tinymce.wp-editor.content td {
line-height: 1.2;
margin: 0;
overflow: visible;
padding: 0.5em;
}
body#tinymce.wp-editor.content caption {
text-align: center;
padding: 0.5em;
}
body#tinymce.wp-editor.content thead {
vertical-align: bottom;
white-space: nowrap;
}
body#tinymce.wp-editor.content th {
text-align: right;
}
/* Forms ------------------------------------- */
body#tinymce.wp-editor.content fieldset {
border: 2px solid #dcd7ca;
padding: 30px;
}
body#tinymce.wp-editor.content fieldset legend {
font-size: 0.85em;
font-weight: 700;
padding: 0 15px;
}
body#tinymce.wp-editor.content label {
display: block;
font-size: 15px;
font-weight: 600;
margin: 0 0 5px 0;
}
body#tinymce.wp-editor.content input,
body#tinymce.wp-editor.content textarea {
border-color: #dcd7ca;
color: inherit;
font-family: inherit;
font-size: inherit;
}
body#tinymce.wp-editor.content input[type="text"],
body#tinymce.wp-editor.content input[type="password"],
body#tinymce.wp-editor.content input[type="email"],
body#tinymce.wp-editor.content input[type="url"],
body#tinymce.wp-editor.content input[type="date"],
body#tinymce.wp-editor.content input[type="month"],
body#tinymce.wp-editor.content input[type="time"],
body#tinymce.wp-editor.content input[type="datetime"],
body#tinymce.wp-editor.content input[type="datetime-local"],
body#tinymce.wp-editor.content input[type="week"],
body#tinymce.wp-editor.content input[type="number"],
body#tinymce.wp-editor.content input[type="search"],
body#tinymce.wp-editor.content input[type="tel"],
body#tinymce.wp-editor.content input[type="color"],
body#tinymce.wp-editor.content textarea {
-webkit-appearance: none;
-moz-appearance: none;
background: transparent;
border-radius: 3px;
border-style: solid;
border-width: 0.1rem;
box-shadow: none;
display: block;
font-size: inherit;
font-weight: 400;
margin: 0;
max-width: 100%;
padding: 13.5px 18px;
width: 100%;
word-break: normal;
}
body#tinymce.wp-editor.content textarea {
height: 200px;
line-height: 1.5;
width: 100%;
}
body#tinymce.wp-editor.content button,
body#tinymce.wp-editor.content .faux-button,
body#tinymce.wp-editor.content .wp-block-button__link,
body#tinymce.wp-editor.content .wp-block-file__button,
body#tinymce.wp-editor.content input[type="button"],
body#tinymce.wp-editor.content input[type="reset"],
body#tinymce.wp-editor.content input[type="submit"] {
-webkit-appearance: none;
-moz-appearance: none;
background: #cd2653;
border: none;
border-radius: 0;
color: #fff;
cursor: pointer;
display: inline-block;
font-size: 17px;
font-weight: 600;
letter-spacing: 0.0333em;
line-height: 1.25;
margin: 0;
padding: 1.1em 1.44em;
text-align: center;
text-decoration: none;
text-transform: uppercase;
}
body#tinymce.wp-editor.content button:focus,
body#tinymce.wp-editor.content button:hover,
body#tinymce.wp-editor.content .faux-button:hover,
body#tinymce.wp-editor.content .faux-button:focus,
body#tinymce.wp-editor.content .wp-block-button__link:focus,
body#tinymce.wp-editor.content .wp-block-button__link:hover,
body#tinymce.wp-editor.content .wp-block-file__button:focus,
body#tinymce.wp-editor.content .wp-block-file__button:hover,
body#tinymce.wp-editor.content input[type="button"]:focus,
body#tinymce.wp-editor.content input[type="button"]:hover,
body#tinymce.wp-editor.content input[type="reset"]:focus,
body#tinymce.wp-editor.content input[type="reset"]:hover,
body#tinymce.wp-editor.content input[type="submit"]:focus,
body#tinymce.wp-editor.content input[type="submit"]:hover {
color: #fff;
text-decoration: underline;
}
.wp-block-button:not(.alignleft):not(.alignright) {
margin-bottom: 30px;
margin-top: 30px;
}
/* BUTTON ALIGN: CENTER */
.wp-block-button.aligncenter {
text-align: center;
}
/* BUTTON STYLE: OUTLINE */
body#tinymce.wp-editor.content .is-style-outline .wp-block-button__link,
body#tinymce.wp-editor.content .is-style-outline .wp-block-button__link:focus,
body#tinymce.wp-editor.content .is-style-outline .wp-block-button__link:hover {
color: #cd2653;
}
body#tinymce.wp-editor.content .is-style-outline .wp-block-button__link {
background: none;
border: 2px solid currentColor;
padding: calc(1.1em - 2px) calc(1.44em - 2px);
}
/* BUTTON STYLE: SQUARED */
body#tinymce.wp-editor.content .is-style-squared .wp-block-button__link {
border-radius: 0;
}
/* Blocks ------------------------------------ */
/* BLOCK: HELPER CLASSES */
body#tinymce.wp-editor.content .has-background {
padding: 20px;
}
/* BLOCK: GALLERY */
body#tinymce.wp-editor.content ul.wp-block-gallery {
list-style: none;
margin-right: 0;
}
body#tinymce.wp-editor.content ul.wp-block-gallery li {
margin-right: 0;
}

View File

@ -0,0 +1,604 @@
/* -------------------------------------------------------------------------- */
/* Twenty Twenty Editor Styles Classic Editor
/* -------------------------------------------------------------------------- */
/* Fonts ------------------------------------- */
/*
* Chrome renders extra-wide &nbsp; characters for the Hoefler Text font.
* This results in a jumping cursor when typing in both the classic editor and
* block editor. The following font-face override fixes the issue by manually
* inserting a custom font that includes just a Hoefler Text space replacement
* for that character instead.
*/
@font-face {
font-family: NonBreakingSpaceOverride;
src: url(data:application/font-woff2;charset=utf-8;base64,d09GMgABAAAAAAMoAA0AAAAACDQAAALTAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP0ZGVE0cGh4GYACCahEICjx3CywAATYCJANUBCAFhiEHgWwbXQfILgpsY+rQRRARwyAs6uL7pxzYhxEE+32b3aeHmifR6tklkS9hiZA0ewkqGRJE+H7/+6378ASViK/PGeavqJyOzsceKi1s3BCiQsiOdn1r/RBgIJYEgCUhbm/8/8/h4saPssnTNkkiWUBrTRtjmQSajw3Ui3pZ3LYDPD+XG2C3JA/yKAS8/rU5eNfuGqRf4eNNgV4YAlIIgxglEkWe6FYpq10+wi3g+/nUgvgPFczNrz/RsTgVm/zfbPuHZlsuQECxuyqBcQwKFBjFgKO8AqP4bAN9tFJtnM9xPcbNjeXS/x1wY/xU52f5W/X1+9cnH4YwKIaoRRAkUkj/YlAAeF/624foiIDBgBmgQBeGAyhBljUPZUm/l2dTvmpqcBDUOHdbPZWd8JsBAsGr4w8/EDn82/bUPx4eh0YNrQTBuHO2FjQEAGBwK0DeI37DpQVqdERS4gZBhpeUhWCfLFz7J99aEBgsJCHvUGAdAPp4IADDCAPCEFMGpMZ9AQpTfQtQGhLbGVBZFV8BaqNyP68oTZgHNj3M8kBPfXTTC9t90UuzYhy9ciH0grVlOcqyCytisvbsERsEYztiznR0WCrmTksJwbSNK6fd1Rvr25I9oLvctUoEbNOmXJbqgYgPXEHJ82IUsrCnpkxh23F1rfZ2zcRnJYoXtauB3VTFkFXQg3uoZYD5qE0kdjDtoDoF1h2bulGmev5HbYhbrjtohQSRI4aNOkffIcT+d3v6atpaYh3JvPoQsztCcqvaBkppDSPcQ3bw3KaCBo1f5CJWTZEgW3LjLofYg51MaVezrx8xZitYbQ9KYeoRaqQdVLwSEfrKXLK1otCWOKNdR/YwYAfon5Yk8O2MJfSD10dPGA5PIJJQMkah0ugMJiv6x4Dm7LEa8xnrRGGGLAg4sAlbsA07sAt76DOsXKO3hIjtIlpnnFrt1qW4kh6NhS83P/6HB/fl1SMAAA==) format("woff2"), url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUQAA0AAAAACDQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAE9AAAABwAAAAchf5yU0dERUYAAATYAAAAHAAAAB4AJwAbT1MvMgAAAaAAAABJAAAAYJAcgU5jbWFwAAACIAAAAF4AAAFqUUxBZ2dhc3AAAATQAAAACAAAAAgAAAAQZ2x5ZgAAApAAAAAyAAAAPL0n8y9oZWFkAAABMAAAADAAAAA2Fi93Z2hoZWEAAAFgAAAAHQAAACQOSgWaaG10eAAAAewAAAAzAAAAVC7TAQBsb2NhAAACgAAAABAAAAAsAOQBAm1heHAAAAGAAAAAHQAAACAAWQALbmFtZQAAAsQAAAF6AAADIYvD/Adwb3N0AAAEQAAAAI4AAADsapk2o3jaY2BkYGAA4ov5mwzj+W2+MnCzXwCKMNzgCBSB0LfbQDQ7AxuI4mBgAlEAFKQIRHjaY2BkYGD3+NvCwMDBAALsDAyMDKhAFAA3+wH3AAAAeNpjYGRgYBBl4GBgYgABEMnIABJzAPMZAAVmAGUAAAB42mNgZlJhnMDAysDCKsKygYGBYRqEZtrDYMT4D8gHSmEHjgUFOQwODAqqf9g9/rYwMLB7MNUAhRlBcsxBrMlASoGBEQAj8QtyAAAAeNrjYGBkAAGmWQwMjO8gmBnIZ2NA0ExAzNjAAFYJVn0ASBsD6VAIDZb7AtELAgANIgb9AHjaY2BgYGaAYBkGRgYQSAHyGMF8FgYPIM3HwMHAxMDGoMCwQIFLQV8hXvXP//9AcRCfAcb///h/ygPW+w/vb7olBjUHCTCyMcAFGZmABBO6AogThgZgIUsXAEDcEzcAAHjaY2BgECMCyoEgACZaAed42mNgYmRgYGBnYGNgYAZSDJqMgorCgoqCjECRXwwNrCAKSP5mAAFGBiRgyAAAi/YFBQAAeNqtkc1OwkAUhU/5M25cEhcsZick0AwlBJq6MWwgJkAgYV/KAA2lJeUn+hY+gktXvpKv4dLTMqKycGHsTZNv7px7z50ZAFd4hYHjdw1Ls4EiHjVncIFnzVnc4F1zDkWjrzmPW+NNcwGlzIRKI3fJlUyrEjZQxb3mDH2fNGfRx4vmHKqG0JzHg6E0F9DOlFBGBxUI1GEzLNT4S0aLuTtsGAEUuYcQHkyg3KmIum1bNUvKlrjbbAIleqHHnS4iSudpQcySMYtdFiXlAxzSbAwfMxK6kZoHKhbjjespMTioOPZnzI+4ucCeTVyKMVKLfeAS6vSWaTinuZwzyy/Dc7vaed+6KaV0kukdPUk6yOcctZPvvxxqksq2lEW8RvHjMEO2FCl/zy6p3NEm0R9OFSafJdldc4QVeyaaObMBO0/5cCaa6d9Ggyubxire+lEojscdjoWUR1xGOy8KD8mG2ZLO2l2paDc3A39qmU2z2W5YNv5+u79e6QfGJY/hAAB42m3NywrCMBQE0DupWp/1AYI7/6DEaLQu66Mrd35BKUWKJSlFv1+rue4cGM7shgR981qSon+ZNwUJ8iDgoYU2OvDRRQ99DDDECAHGmGCKmf80hZSx/Kik/LliFbtmN6xmt+yOjdg9GztV4tROnRwX/Bsaaw51nt4Lc7tWaZYHp/MlzKx51LZs5htNri+2AAAAAQAB//8AD3jaY2BkYGDgAWIxIGZiYARCESBmAfMYAAR6AEMAAAABAAAAANXtRbgAAAAA2AhRFAAAAADYCNuG) format("woff");
}
/* ----------------------------------------------
Inter variable font. Usage:
@supports (font-variation-settings: normal) {
html { font-family: "Inter var", sans-serif; }
}
---------------------------------------------- */
@font-face {
font-family: "Inter var";
font-weight: 100 900; /* stylelint-disable-line font-weight-notation */
font-style: normal;
src: url(../fonts/inter/Inter-upright-var.woff2) format("woff2");
}
@font-face {
font-family: "Inter var";
font-weight: 100 900; /* stylelint-disable-line font-weight-notation */
font-style: italic;
src: url(../fonts/inter/Inter-italic-var.woff2) format("woff2");
}
/* Structure --------------------------------- */
body#tinymce.wp-editor.content { /* stylelint-disable-line no-duplicate-selectors */
font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, sans-serif;
}
@supports ( font-variation-settings: normal ) {
body#tinymce.wp-editor.content { /* stylelint-disable-line no-duplicate-selectors */
font-family: "Inter var", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, sans-serif;
}
}
body#tinymce.wp-editor.content { /* stylelint-disable-line no-duplicate-selectors */
background: #f5efe0;
color: #000;
font-size: 21px;
letter-spacing: -0.015em;
margin: 0 auto;
max-width: calc(100% - 40px);
width: 580px;
}
body#tinymce.wp-editor.content * {
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
}
body#tinymce.wp-editor.content p,
body#tinymce.wp-editor.content ol,
body#tinymce.wp-editor.content ul,
body#tinymce.wp-editor.content dl,
body#tinymce.wp-editor.content dt {
font-family: NonBreakingSpaceOverride, "Hoefler Text", Garamond, "Times New Roman", serif;
letter-spacing: normal;
}
body#tinymce.wp-editor.content p,
body#tinymce.wp-editor.content ul,
body#tinymce.wp-editor.content ol,
body#tinymce.wp-editor.content blockquote {
line-height: 1.5;
margin-bottom: 1.5em;
}
body#tinymce.wp-editor.content code,
body#tinymce.wp-editor.content kbd,
body#tinymce.wp-editor.content samp {
background: rgba(0, 0, 0, 0.075);
}
body#tinymce.wp-editor.content code,
body#tinymce.wp-editor.content kbd,
body#tinymce.wp-editor.content pre,
body#tinymce.wp-editor.content samp {
font-family: monospace;
color: inherit;
font-size: 15px;
}
body#tinymce.wp-editor.content pre {
border: 1px solid #dcd7ca;
line-height: 1.5;
margin: 40px 0;
overflow: auto;
padding: 30px;
text-align: left;
}
body#tinymce.wp-editor.content a,
body#tinymce.wp-editor.content a:focus,
body#tinymce.wp-editor.content a:hover {
color: #cd2653;
text-decoration: underline;
}
body#tinymce.wp-editor.content img {
height: auto;
max-width: 100%;
}
body#tinymce.wp-editor.content img[data-wp-more] {
height: 16px;
}
body#tinymce.wp-editor.content hr {
border: none;
border-top: 1px solid #dcd7ca;
margin: 2em auto;
width: 100%;
}
body#tinymce.wp-editor.content hr:not(.is-style-dots) {
background: linear-gradient(to left, currentColor calc(50% - 16px), transparent calc(50% - 16px), transparent calc(50% + 16px), currentColor calc(50% + 16px));
border: none;
color: #6d6d6d;
height: 1px;
margin: 80px 0;
overflow: visible;
position: relative;
}
body#tinymce.wp-editor.content hr:not(.is-style-dots)::before,
body#tinymce.wp-editor.content hr:not(.is-style-dots)::after {
background: currentColor;
content: "";
display: block;
height: 16px;
position: absolute;
top: calc(50% - 8px);
transform: rotate(22.5deg);
width: 1px;
}
body#tinymce.wp-editor.content hr::before {
left: calc(50% - 5px);
}
body#tinymce.wp-editor.content hr::after {
right: calc(50% - 5px);
}
body#tinymce.wp-editor.content dt {
font-weight: 600;
}
body#tinymce.wp-editor.content dd {
line-height: 1.5;
}
body#tinymce.wp-editor.content dd + dt {
margin-top: 1.5rem;
}
/* Font Families ----------------------------- */
body#tinymce.wp-editor.content figcaption,
body#tinymce.wp-editor.content .wp-caption-text,
body#tinymce.wp-editor.content .wp-caption-dd,
body#tinymce.wp-editor.content cite,
body#tinymce.wp-editor.content table {
font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, sans-serif;
line-height: 1;
}
@supports ( font-variation-settings: normal ) {
body#tinymce.wp-editor.content figcaption,
body#tinymce.wp-editor.content .wp-caption-text,
body#tinymce.wp-editor.content .wp-caption-dd,
body#tinymce.wp-editor.content cite,
body#tinymce.wp-editor.content table {
font-family: "Inter var", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, sans-serif;
}
}
/* Titles ------------------------------------ */
body#tinymce.wp-editor.content h1,
body#tinymce.wp-editor.content h2,
body#tinymce.wp-editor.content h3,
body#tinymce.wp-editor.content h4,
body#tinymce.wp-editor.content h5,
body#tinymce.wp-editor.content h6 {
font-feature-settings: "lnum";
font-variant-numeric: lining-nums;
font-weight: 700;
letter-spacing: -0.0415625em;
line-height: 1.25;
margin: 40px 0 25px;
}
body#tinymce.wp-editor.content h1 {
font-size: 84px;
font-weight: 800;
line-height: 1.138888889;
}
body#tinymce.wp-editor.content h2 {
font-size: 48px;
}
body#tinymce.wp-editor.content h3 {
font-size: 40px;
}
body#tinymce.wp-editor.content h4 {
font-size: 32px;
}
body#tinymce.wp-editor.content h5 {
font-size: 24px;
}
body#tinymce.wp-editor.content h6 {
font-size: 18px;
letter-spacing: 0.03125em;
text-transform: uppercase;
}
/* Blockquote -------------------------------- */
body#tinymce.wp-editor.content blockquote {
border: none;
border-left: 2px solid #cd2653;
margin: 0 0 1.6em 0;
padding: 0.25em 0 0.25em 1em;
}
body#tinymce.wp-editor.content blockquote p {
font-style: normal;
font-weight: 400;
margin: 0;
}
body#tinymce.wp-editor.content cite {
color: #6d6d6d;
font-size: 16px;
font-weight: 500;
font-style: normal;
}
body#tinymce.wp-editor.content blockquote cite {
display: block;
margin-top: 20px;
}
/* Lists ------------------------------------- */
body#tinymce.wp-editor.content ul {
margin-left: 1.5em;
padding-left: 0;
list-style: disc;
}
body#tinymce.wp-editor.content ol {
margin-left: 1.5em;
padding-left: 0;
list-style: square;
}
body#tinymce.wp-editor.content ul ul {
list-style: circle;
}
body#tinymce.wp-editor.content ul ul ul {
list-style: square;
}
body#tinymce.wp-editor.content ol ol {
list-style: lower-alpha;
}
body#tinymce.wp-editor.content ol ol ol {
list-style: lower-roman;
}
body#tinymce.wp-editor.content ul ul,
body#tinymce.wp-editor.content ul ol,
body#tinymce.wp-editor.content ol ul,
body#tinymce.wp-editor.content ol ol {
margin-bottom: 0;
}
body#tinymce.wp-editor.content li {
line-height: 1.5;
margin-bottom: 0.5em;
}
body#tinymce.wp-editor.content ol > li:last-child,
body#tinymce.wp-editor.content ul > li:last-child {
margin-bottom: 0;
}
body#tinymce.wp-editor.content ol > li:first-child,
body#tinymce.wp-editor.content ul > li:first-child {
margin-top: 0.5em;
}
/* Post Media -------------------------------- */
body#tinymce.wp-editor.content figure,
body#tinymce.wp-editor.content video {
display: block;
margin: 0;
}
body#tinymce.wp-editor.content .wp-caption {
margin-bottom: 1.5em;
}
body#tinymce.wp-editor.content img.alignleft,
body#tinymce.wp-editor.content .alignleft img,
body#tinymce.wp-editor.content img.aligncenter,
body#tinymce.wp-editor.content .aligncenter img,
body#tinymce.wp-editor.content img.alignright,
body#tinymce.wp-editor.content .alignright img,
body#tinymce.wp-editor.content img.alignnone,
body#tinymce.wp-editor.content .alignnone img {
display: block;
}
body#tinymce.wp-editor.content .aligncenter,
body#tinymce.wp-editor.content .alignnone,
body#tinymce.wp-editor.content .alignwide,
body#tinymce.wp-editor.content .alignfull {
margin: 50px auto;
}
body#tinymce.wp-editor.content .alignleft,
body#tinymce.wp-editor.content .alignright {
margin-bottom: 25px;
max-width: 50%;
}
body#tinymce.wp-editor.content .wp-caption img {
display: block;
}
body#tinymce.wp-editor.content .wp-caption .alignleft,
body#tinymce.wp-editor.content .wp-caption .alignright {
margin-bottom: 0;
}
body#tinymce.wp-editor.content .alignleft {
/*rtl:ignore*/
float: left;
margin-right: 25px;
max-width: 260px;
}
body#tinymce.wp-editor.content .alignright {
/*rtl:ignore*/
float: right;
margin-left: 25px;
max-width: 260px;
}
body#tinymce.wp-editor.content .wpview[data-wpview-type="gallery"] + .wpview[data-wpview-type="gallery"] {
margin-top: -34px;
}
body#tinymce.wp-editor.content figcaption,
body#tinymce.wp-editor.content .wp-caption-text,
body#tinymce.wp-editor.content .wp-caption-dd,
body#tinymce.wp-editor.content .gallery-caption {
color: #6d6d6d;
display: block;
font-size: 15px;
font-weight: 500;
line-height: 1.2;
margin: 18px 0 0;
}
body#tinymce.wp-editor.content figcaption a,
body#tinymce.wp-editor.content .wp-caption-text a,
body#tinymce.wp-editor.content .wp-caption-dd a,
body#tinymce.wp-editor.content .gallery-caption a {
color: inherit;
}
/* Tables ------------------------------------ */
body#tinymce.wp-editor.content table {
border-collapse: collapse;
border-spacing: 0;
empty-cells: show;
font-size: 18px;
width: 100%;
}
body#tinymce.wp-editor.content th,
body#tinymce.wp-editor.content td {
line-height: 1.2;
margin: 0;
overflow: visible;
padding: 0.5em;
}
body#tinymce.wp-editor.content caption {
text-align: center;
padding: 0.5em;
}
body#tinymce.wp-editor.content thead {
vertical-align: bottom;
white-space: nowrap;
}
body#tinymce.wp-editor.content th {
text-align: left;
}
/* Forms ------------------------------------- */
body#tinymce.wp-editor.content fieldset {
border: 2px solid #dcd7ca;
padding: 30px;
}
body#tinymce.wp-editor.content fieldset legend {
font-size: 0.85em;
font-weight: 700;
padding: 0 15px;
}
body#tinymce.wp-editor.content label {
display: block;
font-size: 15px;
font-weight: 600;
margin: 0 0 5px 0;
}
body#tinymce.wp-editor.content input,
body#tinymce.wp-editor.content textarea {
border-color: #dcd7ca;
color: inherit;
font-family: inherit;
font-size: inherit;
}
body#tinymce.wp-editor.content input[type="text"],
body#tinymce.wp-editor.content input[type="password"],
body#tinymce.wp-editor.content input[type="email"],
body#tinymce.wp-editor.content input[type="url"],
body#tinymce.wp-editor.content input[type="date"],
body#tinymce.wp-editor.content input[type="month"],
body#tinymce.wp-editor.content input[type="time"],
body#tinymce.wp-editor.content input[type="datetime"],
body#tinymce.wp-editor.content input[type="datetime-local"],
body#tinymce.wp-editor.content input[type="week"],
body#tinymce.wp-editor.content input[type="number"],
body#tinymce.wp-editor.content input[type="search"],
body#tinymce.wp-editor.content input[type="tel"],
body#tinymce.wp-editor.content input[type="color"],
body#tinymce.wp-editor.content textarea {
-webkit-appearance: none;
-moz-appearance: none;
background: transparent;
border-radius: 3px;
border-style: solid;
border-width: 0.1rem;
box-shadow: none;
display: block;
font-size: inherit;
font-weight: 400;
margin: 0;
max-width: 100%;
padding: 13.5px 18px;
width: 100%;
word-break: normal;
}
body#tinymce.wp-editor.content textarea {
height: 200px;
line-height: 1.5;
width: 100%;
}
body#tinymce.wp-editor.content button,
body#tinymce.wp-editor.content .faux-button,
body#tinymce.wp-editor.content .wp-block-button__link,
body#tinymce.wp-editor.content .wp-block-file__button,
body#tinymce.wp-editor.content input[type="button"],
body#tinymce.wp-editor.content input[type="reset"],
body#tinymce.wp-editor.content input[type="submit"] {
-webkit-appearance: none;
-moz-appearance: none;
background: #cd2653;
border: none;
border-radius: 0;
color: #fff;
cursor: pointer;
display: inline-block;
font-size: 17px;
font-weight: 600;
letter-spacing: 0.0333em;
line-height: 1.25;
margin: 0;
padding: 1.1em 1.44em;
text-align: center;
text-decoration: none;
text-transform: uppercase;
}
body#tinymce.wp-editor.content button:focus,
body#tinymce.wp-editor.content button:hover,
body#tinymce.wp-editor.content .faux-button:hover,
body#tinymce.wp-editor.content .faux-button:focus,
body#tinymce.wp-editor.content .wp-block-button__link:focus,
body#tinymce.wp-editor.content .wp-block-button__link:hover,
body#tinymce.wp-editor.content .wp-block-file__button:focus,
body#tinymce.wp-editor.content .wp-block-file__button:hover,
body#tinymce.wp-editor.content input[type="button"]:focus,
body#tinymce.wp-editor.content input[type="button"]:hover,
body#tinymce.wp-editor.content input[type="reset"]:focus,
body#tinymce.wp-editor.content input[type="reset"]:hover,
body#tinymce.wp-editor.content input[type="submit"]:focus,
body#tinymce.wp-editor.content input[type="submit"]:hover {
color: #fff;
text-decoration: underline;
}
.wp-block-button:not(.alignleft):not(.alignright) {
margin-bottom: 30px;
margin-top: 30px;
}
/* BUTTON ALIGN: CENTER */
.wp-block-button.aligncenter {
text-align: center;
}
/* BUTTON STYLE: OUTLINE */
body#tinymce.wp-editor.content .is-style-outline .wp-block-button__link,
body#tinymce.wp-editor.content .is-style-outline .wp-block-button__link:focus,
body#tinymce.wp-editor.content .is-style-outline .wp-block-button__link:hover {
color: #cd2653;
}
body#tinymce.wp-editor.content .is-style-outline .wp-block-button__link {
background: none;
border: 2px solid currentColor;
padding: calc(1.1em - 2px) calc(1.44em - 2px);
}
/* BUTTON STYLE: SQUARED */
body#tinymce.wp-editor.content .is-style-squared .wp-block-button__link {
border-radius: 0;
}
/* Blocks ------------------------------------ */
/* BLOCK: HELPER CLASSES */
body#tinymce.wp-editor.content .has-background {
padding: 20px;
}
/* BLOCK: GALLERY */
body#tinymce.wp-editor.content ul.wp-block-gallery {
list-style: none;
margin-left: 0;
}
body#tinymce.wp-editor.content ul.wp-block-gallery li {
margin-left: 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,156 @@
/* global Color */
/* eslint no-unused-vars: off */
/**
* Color Calculations.
*
* @since Twenty Twenty 1.0
*
* @param {string} backgroundColor - The background color.
* @param {number} accentHue - The hue for our accent color.
*
* @return {Object} - this
*/
function _twentyTwentyColor( backgroundColor, accentHue ) {
// Set the object properties.
this.backgroundColor = backgroundColor;
this.accentHue = accentHue;
this.bgColorObj = new Color( backgroundColor );
this.textColorObj = this.bgColorObj.getMaxContrastColor();
this.textColor = this.textColorObj.toCSS();
this.isDark = 0.5 > this.bgColorObj.toLuminosity();
this.isLight = ! this.isDark;
// Return the object.
return this;
}
/**
* Builds an array of Color objects based on the accent hue.
* For improved performance we only build half the array
* depending on dark/light background-color.
*
* @since Twenty Twenty 1.0
*
* @return {Object} - this
*/
_twentyTwentyColor.prototype.setAccentColorsArray = function() {
var self = this,
minSaturation = 65,
maxSaturation = 100,
minLightness = 30,
maxLightness = 80,
stepSaturation = 2,
stepLightness = 2,
pushColor = function() {
var colorObj = new Color( {
h: self.accentHue,
s: s,
l: l
} ),
item,
/**
* Get a score for this color in contrast to its background color and surrounding text.
*
* @since Twenty Twenty 1.0
*
* @param {number} contrastBackground - WCAG contrast with the background color.
* @param {number} contrastSurroundingText - WCAG contrast with surrounding text.
* @return {number} - 0 is best, higher numbers have bigger difference with the desired scores.
*/
getScore = function( contrastBackground, contrastSurroundingText ) {
var diffBackground = ( 7 >= contrastBackground ) ? 0 : 7 - contrastBackground,
diffSurroundingText = ( 3 >= contrastSurroundingText ) ? 0 : 3 - contrastSurroundingText;
return diffBackground + diffSurroundingText;
};
item = {
color: colorObj,
contrastBackground: colorObj.getDistanceLuminosityFrom( self.bgColorObj ),
contrastText: colorObj.getDistanceLuminosityFrom( self.textColorObj )
};
// Check a minimum of 4.5:1 contrast with the background and 3:1 with surrounding text.
if ( 4.5 > item.contrastBackground || 3 > item.contrastText ) {
return;
}
// Get a score for this color by multiplying the 2 contrasts.
// We'll use that to sort the array.
item.score = getScore( item.contrastBackground, item.contrastText );
self.accentColorsArray.push( item );
},
s, l, aaa;
this.accentColorsArray = [];
// We're using `for` loops here because they perform marginally better than other loops.
for ( s = minSaturation; s <= maxSaturation; s += stepSaturation ) {
for ( l = minLightness; l <= maxLightness; l += stepLightness ) {
pushColor( s, l );
}
}
// Check if we have colors that are AAA compliant.
aaa = this.accentColorsArray.filter( function( color ) {
return 7 <= color.contrastBackground;
} );
// If we have AAA-compliant colors, always prefer them.
if ( aaa.length ) {
this.accentColorsArray = aaa;
}
// Sort colors by contrast.
this.accentColorsArray.sort( function( a, b ) {
return a.score - b.score;
} );
return this;
};
/**
* Get accessible text-color.
*
* @since Twenty Twenty 1.0
*
* @return {Color} - Returns a Color object.
*/
_twentyTwentyColor.prototype.getTextColor = function() {
return this.textColor;
};
/**
* Get accessible color for the defined accent-hue and background-color.
*
* @since Twenty Twenty 1.0
*
* @return {Color} - Returns a Color object.
*/
_twentyTwentyColor.prototype.getAccentColor = function() {
var fallback;
// If we have colors returns the 1st one - it has the highest score.
if ( this.accentColorsArray[0] ) {
return this.accentColorsArray[0].color;
}
// Fallback.
fallback = new Color( 'hsl(' + this.accentHue + ',75%,50%)' );
return fallback.getReadableContrastingColor( this.bgColorObj, 4.5 );
};
/**
* Return a new instance of the _twentyTwentyColor object.
*
* @since Twenty Twenty 1.0
*
* @param {string} backgroundColor - The background color.
* @param {number} accentHue - The hue for our accent color.
* @return {Object} - this
*/
function twentyTwentyColor( backgroundColor, accentHue ) {// jshint ignore:line
var color = new _twentyTwentyColor( backgroundColor, accentHue );
color.setAccentColorsArray();
return color;
}

View File

@ -0,0 +1,90 @@
/* global twentyTwentyBgColors, twentyTwentyColor, jQuery, wp, _ */
/**
* Customizer enhancements for a better user experience.
*
* Contains extra logic for our Customizer controls & settings.
*
* @since Twenty Twenty 1.0
*/
( function() {
// Wait until the customizer has finished loading.
wp.customize.bind( 'ready', function() {
// Add a listener for accent-color changes.
wp.customize( 'accent_hue', function( value ) {
value.bind( function( to ) {
// Update the value for our accessible colors for all areas.
Object.keys( twentyTwentyBgColors ).forEach( function( context ) {
var backgroundColorValue;
if ( twentyTwentyBgColors[ context ].color ) {
backgroundColorValue = twentyTwentyBgColors[ context ].color;
} else {
backgroundColorValue = wp.customize( twentyTwentyBgColors[ context ].setting ).get();
}
twentyTwentySetAccessibleColorsValue( context, backgroundColorValue, to );
} );
} );
} );
// Add a listener for background-color changes.
Object.keys( twentyTwentyBgColors ).forEach( function( context ) {
wp.customize( twentyTwentyBgColors[ context ].setting, function( value ) {
value.bind( function( to ) {
// Update the value for our accessible colors for this area.
twentyTwentySetAccessibleColorsValue( context, to, wp.customize( 'accent_hue' ).get(), to );
} );
} );
} );
} );
/**
* Updates the value of the "accent_accessible_colors" setting.
*
* @since Twenty Twenty 1.0
*
* @param {string} context The area for which we want to get colors. Can be for example "content", "header" etc.
* @param {string} backgroundColor The background color (HEX value).
* @param {number} accentHue Numeric representation of the selected hue (0 - 359).
*
* @return {void}
*/
function twentyTwentySetAccessibleColorsValue( context, backgroundColor, accentHue ) {
var value, colors;
// Get the current value for our accessible colors, and make sure it's an object.
value = wp.customize( 'accent_accessible_colors' ).get();
value = ( _.isObject( value ) && ! _.isArray( value ) ) ? value : {};
// Get accessible colors for the defined background-color and hue.
colors = twentyTwentyColor( backgroundColor, accentHue );
// Sanity check.
if ( colors.getAccentColor() && 'function' === typeof colors.getAccentColor().toCSS ) {
// Update the value for this context.
value[ context ] = {
text: colors.getTextColor(),
accent: colors.getAccentColor().toCSS(),
background: backgroundColor
};
// Get borders color.
value[ context ].borders = colors.bgColorObj
.clone()
.getReadableContrastingColor( colors.bgColorObj, 1.36 )
.toCSS();
// Get secondary color.
value[ context ].secondary = colors.bgColorObj
.clone()
.getReadableContrastingColor( colors.bgColorObj )
.s( colors.bgColorObj.s() / 2 )
.toCSS();
}
// Change the value.
wp.customize( 'accent_accessible_colors' ).set( value );
// Small hack to save the option.
wp.customize( 'accent_accessible_colors' )._dirty = true;
}
}( jQuery ) );

View File

@ -0,0 +1,186 @@
/* global twentyTwentyBgColors, twentyTwentyPreviewEls, jQuery, _, wp */
/**
* Customizer enhancements for a better user experience.
*
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
*
* @since Twenty Twenty 1.0
*/
( function( $, api, _ ) {
/**
* Return a value for our partial refresh.
*
* @param {Object} partial Current partial.
*
* @return {jQuery.Promise} Resolved promise.
*/
function returnDeferred( partial ) {
var deferred = new $.Deferred();
deferred.resolveWith( partial, _.map( partial.placements(), function() {
return '';
} ) );
return deferred.promise();
}
// Selective refresh for "Fixed Background Image".
api.selectiveRefresh.partialConstructor.cover_fixed = api.selectiveRefresh.Partial.extend( {
/**
* Override the refresh method.
*
* @return {jQuery.Promise} Resolved promise.
*/
refresh: function() {
var partial, cover, params;
partial = this;
params = partial.params;
cover = $( params.selector );
if ( cover.length && cover.hasClass( 'bg-image' ) ) {
cover.toggleClass( 'bg-attachment-fixed' );
}
return returnDeferred( partial );
}
} );
// Selective refresh for "Image Overlay Opacity".
api.selectiveRefresh.partialConstructor.cover_opacity = api.selectiveRefresh.Partial.extend( {
/**
* Input attributes.
*
* @type {Object}
*/
attrs: {},
/**
* Override the refresh method.
*
* @return {jQuery.Promise} Resolved promise.
*/
refresh: function() {
var partial, ranges, attrs, setting, params, cover, className, classNames;
partial = this;
attrs = partial.attrs;
ranges = _.range( attrs.min, attrs.max + attrs.step, attrs.step );
params = partial.params;
setting = api( params.primarySetting );
cover = $( params.selector );
if ( cover.length ) {
classNames = _.map( ranges, function( val ) {
return 'opacity-' + val;
} );
className = classNames[ ranges.indexOf( parseInt( setting.get(), 10 ) ) ];
cover.removeClass( classNames.join( ' ' ) );
cover.addClass( className );
}
return returnDeferred( partial );
}
} );
// Add listener for the "header_footer_background_color" control.
api( 'header_footer_background_color', function( value ) {
value.bind( function( to ) {
// Add background color to header and footer wrappers.
$( 'body:not(.overlay-header)#site-header, #site-footer' ).css( 'background-color', to );
// Change body classes if this is the same background-color as the content background.
if ( to.toLowerCase() === api( 'background_color' ).get().toLowerCase() ) {
$( 'body' ).addClass( 'reduced-spacing' );
} else {
$( 'body' ).removeClass( 'reduced-spacing' );
}
} );
} );
// Add listener for the "background_color" control.
api( 'background_color', function( value ) {
value.bind( function( to ) {
// Change body classes if this is the same background-color as the header/footer background.
if ( to.toLowerCase() === api( 'header_footer_background_color' ).get().toLowerCase() ) {
$( 'body' ).addClass( 'reduced-spacing' );
} else {
$( 'body' ).removeClass( 'reduced-spacing' );
}
} );
} );
// Add listener for the accent color.
api( 'accent_hue', function( value ) {
value.bind( function() {
// Generate the styles.
// Add a small delay to be sure the accessible colors were generated.
setTimeout( function() {
Object.keys( twentyTwentyBgColors ).forEach( function( context ) {
twentyTwentyGenerateColorA11yPreviewStyles( context );
} );
}, 50 );
} );
} );
// Add listeners for background-color settings.
Object.keys( twentyTwentyBgColors ).forEach( function( context ) {
wp.customize( twentyTwentyBgColors[ context ].setting, function( value ) {
value.bind( function() {
// Generate the styles.
// Add a small delay to be sure the accessible colors were generated.
setTimeout( function() {
twentyTwentyGenerateColorA11yPreviewStyles( context );
}, 50 );
} );
} );
} );
/**
* Add styles to elements in the preview pane.
*
* @since Twenty Twenty 1.0
*
* @param {string} context The area for which we want to generate styles. Can be for example "content", "header" etc.
*
* @return {void}
*/
function twentyTwentyGenerateColorA11yPreviewStyles( context ) {
// Get the accessible colors option.
var a11yColors = window.parent.wp.customize( 'accent_accessible_colors' ).get(),
stylesheedID = 'twentytwenty-customizer-styles-' + context,
stylesheet = $( '#' + stylesheedID ),
styles = '';
// If the stylesheet doesn't exist, create it and append it to <head>.
if ( ! stylesheet.length ) {
$( '#twentytwenty-style-inline-css' ).after( '<style id="' + stylesheedID + '"></style>' );
stylesheet = $( '#' + stylesheedID );
}
if ( ! _.isUndefined( a11yColors[ context ] ) ) {
// Check if we have elements defined.
if ( twentyTwentyPreviewEls[ context ] ) {
_.each( twentyTwentyPreviewEls[ context ], function( items, setting ) {
_.each( items, function( elements, property ) {
if ( ! _.isUndefined( a11yColors[ context ][ setting ] ) ) {
styles += elements.join( ',' ) + '{' + property + ':' + a11yColors[ context ][ setting ] + ';}';
}
} );
} );
}
}
// Add styles.
stylesheet.html( styles );
}
// Generate styles on load. Handles page-changes on the preview pane.
$( document ).ready( function() {
twentyTwentyGenerateColorA11yPreviewStyles( 'content' );
twentyTwentyGenerateColorA11yPreviewStyles( 'header-footer' );
} );
}( jQuery, wp.customize, _ ) );

View File

@ -0,0 +1,27 @@
/* global wp, jQuery */
( function( $, api ) {
$( document ).ready( function() {
// Make it possible to reset the color based on a radio input's value.
// `active` can be either `custom` or `default`.
api.control( 'accent_hue_active' ).setting.bind( function( active ) {
var control = api.control( 'accent_hue' ); // Get the accent hue control.
if ( 'custom' === active ) {
// Activate the hue color picker control and focus it.
control.activate( {
completeCallback: function() {
control.focus();
}
} );
} else {
// If the `custom` option isn't selected, deactivate the hue color picker and set a default.
control.deactivate( {
completeCallback: function() {
control.setting.set( control.params.defaultValue );
}
} );
}
} );
} );
}( jQuery, wp.customize ) );

View File

@ -0,0 +1,9 @@
/**
* Remove squared button style
*
* @since Twenty Twenty 1.0
*/
/* global wp */
wp.domReady( function() {
wp.blocks.unregisterBlockStyle( 'core/button', 'squared' );
} );

View File

@ -0,0 +1,806 @@
/* -----------------------------------------------------------------------------------------------
Namespace
--------------------------------------------------------------------------------------------------- */
var twentytwenty = twentytwenty || {};
// Set a default value for scrolled.
twentytwenty.scrolled = 0;
// polyfill closest
// https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill
if ( ! Element.prototype.closest ) {
Element.prototype.closest = function( s ) {
var el = this;
do {
if ( el.matches( s ) ) {
return el;
}
el = el.parentElement || el.parentNode;
} while ( el !== null && el.nodeType === 1 );
return null;
};
}
// polyfill forEach
// https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach#Polyfill
if ( window.NodeList && ! NodeList.prototype.forEach ) {
NodeList.prototype.forEach = function( callback, thisArg ) {
var i;
var len = this.length;
thisArg = thisArg || window;
for ( i = 0; i < len; i++ ) {
callback.call( thisArg, this[ i ], i, this );
}
};
}
// event "polyfill"
twentytwenty.createEvent = function( eventName ) {
var event;
if ( typeof window.Event === 'function' ) {
event = new Event( eventName );
} else {
event = document.createEvent( 'Event' );
event.initEvent( eventName, true, false );
}
return event;
};
// matches "polyfill"
// https://developer.mozilla.org/es/docs/Web/API/Element/matches
if ( ! Element.prototype.matches ) {
Element.prototype.matches =
Element.prototype.matchesSelector ||
Element.prototype.mozMatchesSelector ||
Element.prototype.msMatchesSelector ||
Element.prototype.oMatchesSelector ||
Element.prototype.webkitMatchesSelector ||
function( s ) {
var matches = ( this.document || this.ownerDocument ).querySelectorAll( s ),
i = matches.length;
while ( --i >= 0 && matches.item( i ) !== this ) {}
return i > -1;
};
}
// Add a class to the body for when touch is enabled for browsers that don't support media queries
// for interaction media features. Adapted from <https://codepen.io/Ferie/pen/vQOMmO>.
twentytwenty.touchEnabled = {
init: function() {
var matchMedia = function() {
// Include the 'heartz' as a way to have a non matching MQ to help terminate the join. See <https://git.io/vznFH>.
var prefixes = [ '-webkit-', '-moz-', '-o-', '-ms-' ];
var query = [ '(', prefixes.join( 'touch-enabled),(' ), 'heartz', ')' ].join( '' );
return window.matchMedia && window.matchMedia( query ).matches;
};
if ( ( 'ontouchstart' in window ) || ( window.DocumentTouch && document instanceof window.DocumentTouch ) || matchMedia() ) {
document.body.classList.add( 'touch-enabled' );
}
}
}; // twentytwenty.touchEnabled
/* -----------------------------------------------------------------------------------------------
Cover Modals
--------------------------------------------------------------------------------------------------- */
twentytwenty.coverModals = {
init: function() {
if ( document.querySelector( '.cover-modal' ) ) {
// Handle cover modals when they're toggled.
this.onToggle();
// When toggled, untoggle if visitor clicks on the wrapping element of the modal.
this.outsideUntoggle();
// Close on escape key press.
this.closeOnEscape();
// Hide and show modals before and after their animations have played out.
this.hideAndShowModals();
}
},
// Handle cover modals when they're toggled.
onToggle: function() {
document.querySelectorAll( '.cover-modal' ).forEach( function( element ) {
element.addEventListener( 'toggled', function( event ) {
var modal = event.target,
body = document.body;
if ( modal.classList.contains( 'active' ) ) {
body.classList.add( 'showing-modal' );
} else {
body.classList.remove( 'showing-modal' );
body.classList.add( 'hiding-modal' );
// Remove the hiding class after a delay, when animations have been run.
setTimeout( function() {
body.classList.remove( 'hiding-modal' );
}, 500 );
}
} );
} );
},
// Close modal on outside click.
outsideUntoggle: function() {
document.addEventListener( 'click', function( event ) {
var target = event.target;
var modal = document.querySelector( '.cover-modal.active' );
if ( target === modal ) {
this.untoggleModal( target );
}
}.bind( this ) );
},
// Close modal on escape key press.
closeOnEscape: function() {
document.addEventListener( 'keydown', function( event ) {
if ( event.keyCode === 27 ) {
event.preventDefault();
document.querySelectorAll( '.cover-modal.active' ).forEach( function( element ) {
this.untoggleModal( element );
}.bind( this ) );
}
}.bind( this ) );
},
// Hide and show modals before and after their animations have played out.
hideAndShowModals: function() {
var _doc = document,
_win = window,
modals = _doc.querySelectorAll( '.cover-modal' ),
htmlStyle = _doc.documentElement.style,
adminBar = _doc.querySelector( '#wpadminbar' );
function getAdminBarHeight( negativeValue ) {
var height,
currentScroll = _win.pageYOffset;
if ( adminBar ) {
height = currentScroll + adminBar.getBoundingClientRect().height;
return negativeValue ? -height : height;
}
return currentScroll === 0 ? 0 : -currentScroll;
}
function htmlStyles() {
var overflow = _win.innerHeight > _doc.documentElement.getBoundingClientRect().height;
return {
'overflow-y': overflow ? 'hidden' : 'scroll',
position: 'fixed',
width: '100%',
top: getAdminBarHeight( true ) + 'px',
left: 0
};
}
// Show the modal.
modals.forEach( function( modal ) {
modal.addEventListener( 'toggle-target-before-inactive', function( event ) {
var styles = htmlStyles(),
offsetY = _win.pageYOffset,
paddingTop = ( Math.abs( getAdminBarHeight() ) - offsetY ) + 'px',
mQuery = _win.matchMedia( '(max-width: 600px)' );
if ( event.target !== modal ) {
return;
}
Object.keys( styles ).forEach( function( styleKey ) {
htmlStyle.setProperty( styleKey, styles[ styleKey ] );
} );
_win.twentytwenty.scrolled = parseInt( styles.top, 10 );
if ( adminBar ) {
_doc.body.style.setProperty( 'padding-top', paddingTop );
if ( mQuery.matches ) {
if ( offsetY >= getAdminBarHeight() ) {
modal.style.setProperty( 'top', 0 );
} else {
modal.style.setProperty( 'top', ( getAdminBarHeight() - offsetY ) + 'px' );
}
}
}
modal.classList.add( 'show-modal' );
} );
// Hide the modal after a delay, so animations have time to play out.
modal.addEventListener( 'toggle-target-after-inactive', function( event ) {
if ( event.target !== modal ) {
return;
}
setTimeout( function() {
var clickedEl = twentytwenty.toggles.clickedEl;
modal.classList.remove( 'show-modal' );
Object.keys( htmlStyles() ).forEach( function( styleKey ) {
htmlStyle.removeProperty( styleKey );
} );
if ( adminBar ) {
_doc.body.style.removeProperty( 'padding-top' );
modal.style.removeProperty( 'top' );
}
if ( clickedEl !== false ) {
clickedEl.focus();
clickedEl = false;
}
_win.scrollTo( 0, Math.abs( _win.twentytwenty.scrolled + getAdminBarHeight() ) );
_win.twentytwenty.scrolled = 0;
}, 500 );
} );
} );
},
// Untoggle a modal.
untoggleModal: function( modal ) {
var modalTargetClass,
modalToggle = false;
// If the modal has specified the string (ID or class) used by toggles to target it, untoggle the toggles with that target string.
// The modal-target-string must match the string toggles use to target the modal.
if ( modal.dataset.modalTargetString ) {
modalTargetClass = modal.dataset.modalTargetString;
modalToggle = document.querySelector( '*[data-toggle-target="' + modalTargetClass + '"]' );
}
// If a modal toggle exists, trigger it so all of the toggle options are included.
if ( modalToggle ) {
modalToggle.click();
// If one doesn't exist, just hide the modal.
} else {
modal.classList.remove( 'active' );
}
}
}; // twentytwenty.coverModals
/* -----------------------------------------------------------------------------------------------
Intrinsic Ratio Embeds
--------------------------------------------------------------------------------------------------- */
twentytwenty.intrinsicRatioVideos = {
init: function() {
this.makeFit();
window.addEventListener( 'resize', function() {
this.makeFit();
}.bind( this ) );
},
makeFit: function() {
document.querySelectorAll( 'iframe, object, video' ).forEach( function( video ) {
var ratio, iTargetWidth,
container = video.parentNode;
// Skip videos we want to ignore.
if ( video.classList.contains( 'intrinsic-ignore' ) || video.parentNode.classList.contains( 'intrinsic-ignore' ) ) {
return true;
}
if ( ! video.dataset.origwidth ) {
// Get the video element proportions.
video.setAttribute( 'data-origwidth', video.width );
video.setAttribute( 'data-origheight', video.height );
}
iTargetWidth = container.offsetWidth;
// Get ratio from proportions.
ratio = iTargetWidth / video.dataset.origwidth;
// Scale based on ratio, thus retaining proportions.
video.style.width = iTargetWidth + 'px';
video.style.height = ( video.dataset.origheight * ratio ) + 'px';
} );
}
}; // twentytwenty.instrinsicRatioVideos
/* -----------------------------------------------------------------------------------------------
Modal Menu
--------------------------------------------------------------------------------------------------- */
twentytwenty.modalMenu = {
init: function() {
// If the current menu item is in a sub level, expand all the levels higher up on load.
this.expandLevel();
this.keepFocusInModal();
},
expandLevel: function() {
var modalMenus = document.querySelectorAll( '.modal-menu' );
modalMenus.forEach( function( modalMenu ) {
var activeMenuItem = modalMenu.querySelector( '.current-menu-item' );
if ( activeMenuItem ) {
twentytwentyFindParents( activeMenuItem, 'li' ).forEach( function( element ) {
var subMenuToggle = element.querySelector( '.sub-menu-toggle' );
if ( subMenuToggle ) {
twentytwenty.toggles.performToggle( subMenuToggle, true );
}
} );
}
} );
},
keepFocusInModal: function() {
var _doc = document;
_doc.addEventListener( 'keydown', function( event ) {
var toggleTarget, modal, selectors, elements, menuType, bottomMenu, activeEl, lastEl, firstEl, tabKey, shiftKey,
clickedEl = twentytwenty.toggles.clickedEl;
if ( clickedEl && _doc.body.classList.contains( 'showing-modal' ) ) {
toggleTarget = clickedEl.dataset.toggleTarget;
selectors = 'input, a, button';
modal = _doc.querySelector( toggleTarget );
elements = modal.querySelectorAll( selectors );
elements = Array.prototype.slice.call( elements );
if ( '.menu-modal' === toggleTarget ) {
menuType = window.matchMedia( '(min-width: 1000px)' ).matches;
menuType = menuType ? '.expanded-menu' : '.mobile-menu';
elements = elements.filter( function( element ) {
return null !== element.closest( menuType ) && null !== element.offsetParent;
} );
elements.unshift( _doc.querySelector( '.close-nav-toggle' ) );
bottomMenu = _doc.querySelector( '.menu-bottom > nav' );
if ( bottomMenu ) {
bottomMenu.querySelectorAll( selectors ).forEach( function( element ) {
elements.push( element );
} );
}
}
lastEl = elements[ elements.length - 1 ];
firstEl = elements[0];
activeEl = _doc.activeElement;
tabKey = event.keyCode === 9;
shiftKey = event.shiftKey;
if ( ! shiftKey && tabKey && lastEl === activeEl ) {
event.preventDefault();
firstEl.focus();
}
if ( shiftKey && tabKey && firstEl === activeEl ) {
event.preventDefault();
lastEl.focus();
}
}
} );
}
}; // twentytwenty.modalMenu
/* -----------------------------------------------------------------------------------------------
Primary Menu
--------------------------------------------------------------------------------------------------- */
twentytwenty.primaryMenu = {
init: function() {
this.focusMenuWithChildren();
},
// The focusMenuWithChildren() function implements Keyboard Navigation in the Primary Menu
// by adding the '.focus' class to all 'li.menu-item-has-children' when the focus is on the 'a' element.
focusMenuWithChildren: function() {
// Get all the link elements within the primary menu.
var links, i, len,
menu = document.querySelector( '.primary-menu-wrapper' );
if ( ! menu ) {
return false;
}
links = menu.getElementsByTagName( 'a' );
// Each time a menu link is focused or blurred, toggle focus.
for ( i = 0, len = links.length; i < len; i++ ) {
links[i].addEventListener( 'focus', toggleFocus, true );
links[i].addEventListener( 'blur', toggleFocus, true );
}
//Sets or removes the .focus class on an element.
function toggleFocus() {
var self = this;
// Move up through the ancestors of the current link until we hit .primary-menu.
while ( -1 === self.className.indexOf( 'primary-menu' ) ) {
// On li elements toggle the class .focus.
if ( 'li' === self.tagName.toLowerCase() ) {
if ( -1 !== self.className.indexOf( 'focus' ) ) {
self.className = self.className.replace( ' focus', '' );
} else {
self.className += ' focus';
}
}
self = self.parentElement;
}
}
}
}; // twentytwenty.primaryMenu
/* -----------------------------------------------------------------------------------------------
Toggles
--------------------------------------------------------------------------------------------------- */
twentytwenty.toggles = {
clickedEl: false,
init: function() {
// Do the toggle.
this.toggle();
// Check for toggle/untoggle on resize.
this.resizeCheck();
// Check for untoggle on escape key press.
this.untoggleOnEscapeKeyPress();
},
performToggle: function( element, instantly ) {
var target, timeOutTime, classToToggle,
self = this,
_doc = document,
// Get our targets.
toggle = element,
targetString = toggle.dataset.toggleTarget,
activeClass = 'active';
// Elements to focus after modals are closed.
if ( ! _doc.querySelectorAll( '.show-modal' ).length ) {
self.clickedEl = _doc.activeElement;
}
if ( targetString === 'next' ) {
target = toggle.nextSibling;
} else {
target = _doc.querySelector( targetString );
}
// Trigger events on the toggle targets before they are toggled.
if ( target.classList.contains( activeClass ) ) {
target.dispatchEvent( twentytwenty.createEvent( 'toggle-target-before-active' ) );
} else {
target.dispatchEvent( twentytwenty.createEvent( 'toggle-target-before-inactive' ) );
}
// Get the class to toggle, if specified.
classToToggle = toggle.dataset.classToToggle ? toggle.dataset.classToToggle : activeClass;
// For cover modals, set a short timeout duration so the class animations have time to play out.
timeOutTime = 0;
if ( target.classList.contains( 'cover-modal' ) ) {
timeOutTime = 10;
}
setTimeout( function() {
var focusElement,
subMenued = target.classList.contains( 'sub-menu' ),
newTarget = subMenued ? toggle.closest( '.menu-item' ).querySelector( '.sub-menu' ) : target,
duration = toggle.dataset.toggleDuration;
// Toggle the target of the clicked toggle.
if ( toggle.dataset.toggleType === 'slidetoggle' && ! instantly && duration !== '0' ) {
twentytwentyMenuToggle( newTarget, duration );
} else {
newTarget.classList.toggle( classToToggle );
}
// If the toggle target is 'next', only give the clicked toggle the active class.
if ( targetString === 'next' ) {
toggle.classList.toggle( activeClass );
} else if ( target.classList.contains( 'sub-menu' ) ) {
toggle.classList.toggle( activeClass );
} else {
// If not, toggle all toggles with this toggle target.
_doc.querySelector( '*[data-toggle-target="' + targetString + '"]' ).classList.toggle( activeClass );
}
// Toggle aria-expanded on the toggle.
twentytwentyToggleAttribute( toggle, 'aria-expanded', 'true', 'false' );
if ( self.clickedEl && -1 !== toggle.getAttribute( 'class' ).indexOf( 'close-' ) ) {
twentytwentyToggleAttribute( self.clickedEl, 'aria-expanded', 'true', 'false' );
}
// Toggle body class.
if ( toggle.dataset.toggleBodyClass ) {
_doc.body.classList.toggle( toggle.dataset.toggleBodyClass );
}
// Check whether to set focus.
if ( toggle.dataset.setFocus ) {
focusElement = _doc.querySelector( toggle.dataset.setFocus );
if ( focusElement ) {
if ( target.classList.contains( activeClass ) ) {
focusElement.focus();
} else {
focusElement.blur();
}
}
}
// Trigger the toggled event on the toggle target.
target.dispatchEvent( twentytwenty.createEvent( 'toggled' ) );
// Trigger events on the toggle targets after they are toggled.
if ( target.classList.contains( activeClass ) ) {
target.dispatchEvent( twentytwenty.createEvent( 'toggle-target-after-active' ) );
} else {
target.dispatchEvent( twentytwenty.createEvent( 'toggle-target-after-inactive' ) );
}
}, timeOutTime );
},
// Do the toggle.
toggle: function() {
var self = this;
document.querySelectorAll( '*[data-toggle-target]' ).forEach( function( element ) {
element.addEventListener( 'click', function( event ) {
event.preventDefault();
self.performToggle( element );
} );
} );
},
// Check for toggle/untoggle on screen resize.
resizeCheck: function() {
if ( document.querySelectorAll( '*[data-untoggle-above], *[data-untoggle-below], *[data-toggle-above], *[data-toggle-below]' ).length ) {
window.addEventListener( 'resize', function() {
var winWidth = window.innerWidth,
toggles = document.querySelectorAll( '.toggle' );
toggles.forEach( function( toggle ) {
var unToggleAbove = toggle.dataset.untoggleAbove,
unToggleBelow = toggle.dataset.untoggleBelow,
toggleAbove = toggle.dataset.toggleAbove,
toggleBelow = toggle.dataset.toggleBelow;
// If no width comparison is set, continue.
if ( ! unToggleAbove && ! unToggleBelow && ! toggleAbove && ! toggleBelow ) {
return;
}
// If the toggle width comparison is true, toggle the toggle.
if (
( ( ( unToggleAbove && winWidth > unToggleAbove ) ||
( unToggleBelow && winWidth < unToggleBelow ) ) &&
toggle.classList.contains( 'active' ) ) ||
( ( ( toggleAbove && winWidth > toggleAbove ) ||
( toggleBelow && winWidth < toggleBelow ) ) &&
! toggle.classList.contains( 'active' ) )
) {
toggle.click();
}
} );
} );
}
},
// Close toggle on escape key press.
untoggleOnEscapeKeyPress: function() {
document.addEventListener( 'keyup', function( event ) {
if ( event.key === 'Escape' ) {
document.querySelectorAll( '*[data-untoggle-on-escape].active' ).forEach( function( element ) {
if ( element.classList.contains( 'active' ) ) {
element.click();
}
} );
}
} );
}
}; // twentytwenty.toggles
/**
* Is the DOM ready?
*
* This implementation is coming from https://gomakethings.com/a-native-javascript-equivalent-of-jquerys-ready-method/
*
* @param {Function} fn Callback function to run.
*/
function twentytwentyDomReady( fn ) {
if ( typeof fn !== 'function' ) {
return;
}
if ( document.readyState === 'interactive' || document.readyState === 'complete' ) {
return fn();
}
document.addEventListener( 'DOMContentLoaded', fn, false );
}
twentytwentyDomReady( function() {
twentytwenty.toggles.init(); // Handle toggles.
twentytwenty.coverModals.init(); // Handle cover modals.
twentytwenty.intrinsicRatioVideos.init(); // Retain aspect ratio of videos on window resize.
twentytwenty.modalMenu.init(); // Modal Menu.
twentytwenty.primaryMenu.init(); // Primary Menu.
twentytwenty.touchEnabled.init(); // Add class to body if device is touch-enabled.
} );
/* -----------------------------------------------------------------------------------------------
Helper functions
--------------------------------------------------------------------------------------------------- */
/* Toggle an attribute ----------------------- */
function twentytwentyToggleAttribute( element, attribute, trueVal, falseVal ) {
if ( trueVal === undefined ) {
trueVal = true;
}
if ( falseVal === undefined ) {
falseVal = false;
}
if ( element.getAttribute( attribute ) !== trueVal ) {
element.setAttribute( attribute, trueVal );
} else {
element.setAttribute( attribute, falseVal );
}
}
/**
* Toggle a menu item on or off.
*
* @param {HTMLElement} target
* @param {number} duration
*/
function twentytwentyMenuToggle( target, duration ) {
var initialParentHeight, finalParentHeight, menu, menuItems, transitionListener,
initialPositions = [],
finalPositions = [];
if ( ! target ) {
return;
}
menu = target.closest( '.menu-wrapper' );
// Step 1: look at the initial positions of every menu item.
menuItems = menu.querySelectorAll( '.menu-item' );
menuItems.forEach( function( menuItem, index ) {
initialPositions[ index ] = { x: menuItem.offsetLeft, y: menuItem.offsetTop };
} );
initialParentHeight = target.parentElement.offsetHeight;
target.classList.add( 'toggling-target' );
// Step 2: toggle target menu item and look at the final positions of every menu item.
target.classList.toggle( 'active' );
menuItems.forEach( function( menuItem, index ) {
finalPositions[ index ] = { x: menuItem.offsetLeft, y: menuItem.offsetTop };
} );
finalParentHeight = target.parentElement.offsetHeight;
// Step 3: close target menu item again.
// The whole process happens without giving the browser a chance to render, so it's invisible.
target.classList.toggle( 'active' );
/*
* Step 4: prepare animation.
* Position all the items with absolute offsets, at the same starting position.
* Shouldn't result in any visual changes if done right.
*/
menu.classList.add( 'is-toggling' );
target.classList.toggle( 'active' );
menuItems.forEach( function( menuItem, index ) {
var initialPosition = initialPositions[ index ];
if ( initialPosition.y === 0 && menuItem.parentElement === target ) {
initialPosition.y = initialParentHeight;
}
menuItem.style.transform = 'translate(' + initialPosition.x + 'px, ' + initialPosition.y + 'px)';
} );
/*
* The double rAF is unfortunately needed, since we're toggling CSS classes, and
* the only way to ensure layout completion here across browsers is to wait twice.
* This just delays the start of the animation by 2 frames and is thus not an issue.
*/
requestAnimationFrame( function() {
requestAnimationFrame( function() {
/*
* Step 5: start animation by moving everything to final position.
* All the layout work has already happened, while we were preparing for the animation.
* The animation now runs entirely in CSS, using cheap CSS properties (opacity and transform)
* that don't trigger the layout or paint stages.
*/
menu.classList.add( 'is-animating' );
menuItems.forEach( function( menuItem, index ) {
var finalPosition = finalPositions[ index ];
if ( finalPosition.y === 0 && menuItem.parentElement === target ) {
finalPosition.y = finalParentHeight;
}
if ( duration !== undefined ) {
menuItem.style.transitionDuration = duration + 'ms';
}
menuItem.style.transform = 'translate(' + finalPosition.x + 'px, ' + finalPosition.y + 'px)';
} );
if ( duration !== undefined ) {
target.style.transitionDuration = duration + 'ms';
}
} );
// Step 6: finish toggling.
// Remove all transient classes when the animation ends.
transitionListener = function() {
menu.classList.remove( 'is-animating' );
menu.classList.remove( 'is-toggling' );
target.classList.remove( 'toggling-target' );
menuItems.forEach( function( menuItem ) {
menuItem.style.transform = '';
menuItem.style.transitionDuration = '';
} );
target.style.transitionDuration = '';
target.removeEventListener( 'transitionend', transitionListener );
};
target.addEventListener( 'transitionend', transitionListener );
} );
}
/**
* Traverses the DOM up to find elements matching the query.
*
* @param {HTMLElement} target
* @param {string} query
* @return {NodeList} parents matching query
*/
function twentytwentyFindParents( target, query ) {
var parents = [];
// Recursively go up the DOM adding matches to the parents array.
function traverse( item ) {
var parent = item.parentNode;
if ( parent instanceof HTMLElement ) {
if ( parent.matches( query ) ) {
parents.push( parent );
}
traverse( parent );
}
}
traverse( target );
return parents;
}

View File

@ -0,0 +1,33 @@
/**
* File skip-link-focus-fix.js.
*
* Helps with accessibility for keyboard only users.
*
* This is the source file for what is minified in the twentytwenty_skip_link_focus_fix() PHP function.
*
* Learn more: https://git.io/vWdr2
*/
( function() {
var isIe = /(trident|msie)/i.test( navigator.userAgent );
if ( isIe && document.getElementById && window.addEventListener ) {
window.addEventListener( 'hashchange', function() {
var id = location.hash.substring( 1 ),
element;
if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) {
return;
}
element = document.getElementById( id );
if ( element ) {
if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) {
element.tabIndex = -1;
}
element.focus();
}
}, false );
}
}() );

View File

@ -0,0 +1,526 @@
<?php
/**
* Customizer settings for this theme.
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
if ( ! class_exists( 'TwentyTwenty_Customize' ) ) {
/**
* CUSTOMIZER SETTINGS
*/
class TwentyTwenty_Customize {
/**
* Register customizer options.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
public static function register( $wp_customize ) {
/**
* Site Title & Description.
* */
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->selective_refresh->add_partial(
'blogname',
array(
'selector' => '.site-title a',
'render_callback' => 'twentytwenty_customize_partial_blogname',
)
);
$wp_customize->selective_refresh->add_partial(
'blogdescription',
array(
'selector' => '.site-description',
'render_callback' => 'twentytwenty_customize_partial_blogdescription',
)
);
$wp_customize->selective_refresh->add_partial(
'custom_logo',
array(
'selector' => '.header-titles [class*=site-]:not(.site-description)',
'render_callback' => 'twentytwenty_customize_partial_site_logo',
)
);
$wp_customize->selective_refresh->add_partial(
'retina_logo',
array(
'selector' => '.header-titles [class*=site-]:not(.site-description)',
'render_callback' => 'twentytwenty_customize_partial_site_logo',
)
);
/**
* Site Identity
*/
/* 2X Header Logo ---------------- */
$wp_customize->add_setting(
'retina_logo',
array(
'capability' => 'edit_theme_options',
'sanitize_callback' => array( __CLASS__, 'sanitize_checkbox' ),
'transport' => 'postMessage',
)
);
$wp_customize->add_control(
'retina_logo',
array(
'type' => 'checkbox',
'section' => 'title_tagline',
'priority' => 10,
'label' => __( 'Retina logo', 'twentytwenty' ),
'description' => __( 'Scales the logo to half its uploaded size, making it sharp on high-res screens.', 'twentytwenty' ),
)
);
// Header & Footer Background Color.
$wp_customize->add_setting(
'header_footer_background_color',
array(
'default' => '#ffffff',
'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'postMessage',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'header_footer_background_color',
array(
'label' => __( 'Header &amp; Footer Background Color', 'twentytwenty' ),
'section' => 'colors',
)
)
);
// Enable picking an accent color.
$wp_customize->add_setting(
'accent_hue_active',
array(
'capability' => 'edit_theme_options',
'sanitize_callback' => array( __CLASS__, 'sanitize_select' ),
'transport' => 'postMessage',
'default' => 'default',
)
);
$wp_customize->add_control(
'accent_hue_active',
array(
'type' => 'radio',
'section' => 'colors',
'label' => __( 'Primary Color', 'twentytwenty' ),
'choices' => array(
'default' => __( 'Default', 'twentytwenty' ),
'custom' => __( 'Custom', 'twentytwenty' ),
),
)
);
/**
* Implementation for the accent color.
* This is different to all other color options because of the accessibility enhancements.
* The control is a hue-only colorpicker, and there is a separate setting that holds values
* for other colors calculated based on the selected hue and various background-colors on the page.
*
* @since Twenty Twenty 1.0
*/
// Add the setting for the hue colorpicker.
$wp_customize->add_setting(
'accent_hue',
array(
'default' => 344,
'type' => 'theme_mod',
'sanitize_callback' => 'absint',
'transport' => 'postMessage',
)
);
// Add setting to hold colors derived from the accent hue.
$wp_customize->add_setting(
'accent_accessible_colors',
array(
'default' => array(
'content' => array(
'text' => '#000000',
'accent' => '#cd2653',
'secondary' => '#6d6d6d',
'borders' => '#dcd7ca',
),
'header-footer' => array(
'text' => '#000000',
'accent' => '#cd2653',
'secondary' => '#6d6d6d',
'borders' => '#dcd7ca',
),
),
'type' => 'theme_mod',
'transport' => 'postMessage',
'sanitize_callback' => array( __CLASS__, 'sanitize_accent_accessible_colors' ),
)
);
// Add the hue-only colorpicker for the accent color.
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'accent_hue',
array(
'section' => 'colors',
'settings' => 'accent_hue',
'description' => __( 'Apply a custom color for links, buttons, featured images.', 'twentytwenty' ),
'mode' => 'hue',
'active_callback' => function() use ( $wp_customize ) {
return ( 'custom' === $wp_customize->get_setting( 'accent_hue_active' )->value() );
},
)
)
);
// Update background color with postMessage, so inline CSS output is updated as well.
$wp_customize->get_setting( 'background_color' )->transport = 'postMessage';
/**
* Theme Options
*/
$wp_customize->add_section(
'options',
array(
'title' => __( 'Theme Options', 'twentytwenty' ),
'priority' => 40,
'capability' => 'edit_theme_options',
)
);
/* Enable Header Search ----------------------------------------------- */
$wp_customize->add_setting(
'enable_header_search',
array(
'capability' => 'edit_theme_options',
'default' => true,
'sanitize_callback' => array( __CLASS__, 'sanitize_checkbox' ),
)
);
$wp_customize->add_control(
'enable_header_search',
array(
'type' => 'checkbox',
'section' => 'options',
'priority' => 10,
'label' => __( 'Show search in header', 'twentytwenty' ),
)
);
/* Show author bio ---------------------------------------------------- */
$wp_customize->add_setting(
'show_author_bio',
array(
'capability' => 'edit_theme_options',
'default' => true,
'sanitize_callback' => array( __CLASS__, 'sanitize_checkbox' ),
)
);
$wp_customize->add_control(
'show_author_bio',
array(
'type' => 'checkbox',
'section' => 'options',
'priority' => 10,
'label' => __( 'Show author bio', 'twentytwenty' ),
)
);
/* Display full content or excerpts on the blog and archives --------- */
$wp_customize->add_setting(
'blog_content',
array(
'capability' => 'edit_theme_options',
'default' => 'full',
'sanitize_callback' => array( __CLASS__, 'sanitize_select' ),
)
);
$wp_customize->add_control(
'blog_content',
array(
'type' => 'radio',
'section' => 'options',
'priority' => 10,
'label' => __( 'On archive pages, posts show:', 'twentytwenty' ),
'choices' => array(
'full' => __( 'Full text', 'twentytwenty' ),
'summary' => __( 'Summary', 'twentytwenty' ),
),
)
);
/**
* Template: Cover Template.
*/
$wp_customize->add_section(
'cover_template_options',
array(
'title' => __( 'Cover Template', 'twentytwenty' ),
'capability' => 'edit_theme_options',
'description' => __( 'Settings for the "Cover Template" page template. Add a featured image to use as background.', 'twentytwenty' ),
'priority' => 42,
)
);
/* Overlay Fixed Background ------ */
$wp_customize->add_setting(
'cover_template_fixed_background',
array(
'capability' => 'edit_theme_options',
'default' => true,
'sanitize_callback' => array( __CLASS__, 'sanitize_checkbox' ),
'transport' => 'postMessage',
)
);
$wp_customize->add_control(
'cover_template_fixed_background',
array(
'type' => 'checkbox',
'section' => 'cover_template_options',
'label' => __( 'Fixed Background Image', 'twentytwenty' ),
'description' => __( 'Creates a parallax effect when the visitor scrolls.', 'twentytwenty' ),
)
);
$wp_customize->selective_refresh->add_partial(
'cover_template_fixed_background',
array(
'selector' => '.cover-header',
'type' => 'cover_fixed',
)
);
/* Separator --------------------- */
$wp_customize->add_setting(
'cover_template_separator_1',
array(
'sanitize_callback' => 'wp_filter_nohtml_kses',
)
);
$wp_customize->add_control(
new TwentyTwenty_Separator_Control(
$wp_customize,
'cover_template_separator_1',
array(
'section' => 'cover_template_options',
)
)
);
/* Overlay Background Color ------ */
$wp_customize->add_setting(
'cover_template_overlay_background_color',
array(
'default' => twentytwenty_get_color_for_area( 'content', 'accent' ),
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'cover_template_overlay_background_color',
array(
'label' => __( 'Overlay Background Color', 'twentytwenty' ),
'description' => __( 'The color used for the overlay. Defaults to the accent color.', 'twentytwenty' ),
'section' => 'cover_template_options',
)
)
);
/* Overlay Text Color ------------ */
$wp_customize->add_setting(
'cover_template_overlay_text_color',
array(
'default' => '#ffffff',
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'cover_template_overlay_text_color',
array(
'label' => __( 'Overlay Text Color', 'twentytwenty' ),
'description' => __( 'The color used for the text in the overlay.', 'twentytwenty' ),
'section' => 'cover_template_options',
)
)
);
/* Overlay Color Opacity --------- */
$wp_customize->add_setting(
'cover_template_overlay_opacity',
array(
'default' => 80,
'sanitize_callback' => 'absint',
'transport' => 'postMessage',
)
);
$wp_customize->add_control(
'cover_template_overlay_opacity',
array(
'label' => __( 'Overlay Opacity', 'twentytwenty' ),
'description' => __( 'Make sure that the contrast is high enough so that the text is readable.', 'twentytwenty' ),
'section' => 'cover_template_options',
'type' => 'range',
'input_attrs' => twentytwenty_customize_opacity_range(),
)
);
$wp_customize->selective_refresh->add_partial(
'cover_template_overlay_opacity',
array(
'selector' => '.cover-color-overlay',
'type' => 'cover_opacity',
)
);
}
/**
* Sanitization callback for the "accent_accessible_colors" setting.
*
* @static
* @access public
* @since Twenty Twenty 1.0
* @param array $value The value we want to sanitize.
* @return array Returns sanitized value. Each item in the array gets sanitized separately.
*/
public static function sanitize_accent_accessible_colors( $value ) {
// Make sure the value is an array. Do not typecast, use empty array as fallback.
$value = is_array( $value ) ? $value : array();
// Loop values.
foreach ( $value as $area => $values ) {
foreach ( $values as $context => $color_val ) {
$value[ $area ][ $context ] = sanitize_hex_color( $color_val );
}
}
return $value;
}
/**
* Sanitize select.
*
* @param string $input The input from the setting.
* @param object $setting The selected setting.
*
* @return string $input|$setting->default The input from the setting or the default setting.
*/
public static function sanitize_select( $input, $setting ) {
$input = sanitize_key( $input );
$choices = $setting->manager->get_control( $setting->id )->choices;
return ( array_key_exists( $input, $choices ) ? $input : $setting->default );
}
/**
* Sanitize boolean for checkbox.
*
* @param bool $checked Whether or not a box is checked.
*
* @return bool
*/
public static function sanitize_checkbox( $checked ) {
return ( ( isset( $checked ) && true === $checked ) ? true : false );
}
}
// Setup the Theme Customizer settings and controls.
add_action( 'customize_register', array( 'TwentyTwenty_Customize', 'register' ) );
}
/**
* PARTIAL REFRESH FUNCTIONS
* */
if ( ! function_exists( 'twentytwenty_customize_partial_blogname' ) ) {
/**
* Render the site title for the selective refresh partial.
*/
function twentytwenty_customize_partial_blogname() {
bloginfo( 'name' );
}
}
if ( ! function_exists( 'twentytwenty_customize_partial_blogdescription' ) ) {
/**
* Render the site description for the selective refresh partial.
*/
function twentytwenty_customize_partial_blogdescription() {
bloginfo( 'description' );
}
}
if ( ! function_exists( 'twentytwenty_customize_partial_site_logo' ) ) {
/**
* Render the site logo for the selective refresh partial.
*
* Doing it this way so we don't have issues with `render_callback`'s arguments.
*/
function twentytwenty_customize_partial_site_logo() {
twentytwenty_site_logo();
}
}
/**
* Input attributes for cover overlay opacity option.
*
* @return array Array containing attribute names and their values.
*/
function twentytwenty_customize_opacity_range() {
/**
* Filter the input attributes for opacity
*
* @param array $attrs {
* The attributes
*
* @type int $min Minimum value
* @type int $max Maximum value
* @type int $step Interval between numbers
* }
*/
return apply_filters(
'twentytwenty_customize_opacity_range',
array(
'min' => 0,
'max' => 90,
'step' => 5,
)
);
}

View File

@ -0,0 +1,122 @@
<?php
/**
* Non-latin language handling.
*
* Handle non-latin language styles.
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
if ( ! class_exists( 'TwentyTwenty_Non_Latin_Languages' ) ) {
/**
* Language handling.
*/
class TwentyTwenty_Non_Latin_Languages {
/**
* Get custom CSS.
*
* Return CSS for non-latin language, if available, or null
*
* @param string $type Whether to return CSS for the "front-end", "block-editor" or "classic-editor".
*
* @return void
*/
public static function get_non_latin_css( $type = 'front-end' ) {
// Fetch site locale.
$locale = get_bloginfo( 'language' );
// Define fallback fonts for non-latin languages.
$font_family = apply_filters(
'twentytwenty_get_localized_font_family_types',
array(
// Arabic.
'ar' => array( 'Tahoma', 'Arial', 'sans-serif' ),
'ary' => array( 'Tahoma', 'Arial', 'sans-serif' ),
'azb' => array( 'Tahoma', 'Arial', 'sans-serif' ),
'ckb' => array( 'Tahoma', 'Arial', 'sans-serif' ),
'fa-IR' => array( 'Tahoma', 'Arial', 'sans-serif' ),
'haz' => array( 'Tahoma', 'Arial', 'sans-serif' ),
'ps' => array( 'Tahoma', 'Arial', 'sans-serif' ),
// Chinese Simplified (China) - Noto Sans SC.
'zh-CN' => array( '\'PingFang SC\'', '\'Helvetica Neue\'', '\'Microsoft YaHei New\'', '\'STHeiti Light\'', 'sans-serif' ),
// Chinese Traditional (Taiwan) - Noto Sans TC.
'zh-TW' => array( '\'PingFang TC\'', '\'Helvetica Neue\'', '\'Microsoft YaHei New\'', '\'STHeiti Light\'', 'sans-serif' ),
// Chinese (Hong Kong) - Noto Sans HK.
'zh-HK' => array( '\'PingFang HK\'', '\'Helvetica Neue\'', '\'Microsoft YaHei New\'', '\'STHeiti Light\'', 'sans-serif' ),
// Cyrillic.
'bel' => array( '\'Helvetica Neue\'', 'Helvetica', '\'Segoe UI\'', 'Arial', 'sans-serif' ),
'bg-BG' => array( '\'Helvetica Neue\'', 'Helvetica', '\'Segoe UI\'', 'Arial', 'sans-serif' ),
'kk' => array( '\'Helvetica Neue\'', 'Helvetica', '\'Segoe UI\'', 'Arial', 'sans-serif' ),
'mk-MK' => array( '\'Helvetica Neue\'', 'Helvetica', '\'Segoe UI\'', 'Arial', 'sans-serif' ),
'mn' => array( '\'Helvetica Neue\'', 'Helvetica', '\'Segoe UI\'', 'Arial', 'sans-serif' ),
'ru-RU' => array( '\'Helvetica Neue\'', 'Helvetica', '\'Segoe UI\'', 'Arial', 'sans-serif' ),
'sah' => array( '\'Helvetica Neue\'', 'Helvetica', '\'Segoe UI\'', 'Arial', 'sans-serif' ),
'sr-RS' => array( '\'Helvetica Neue\'', 'Helvetica', '\'Segoe UI\'', 'Arial', 'sans-serif' ),
'tt-RU' => array( '\'Helvetica Neue\'', 'Helvetica', '\'Segoe UI\'', 'Arial', 'sans-serif' ),
'uk' => array( '\'Helvetica Neue\'', 'Helvetica', '\'Segoe UI\'', 'Arial', 'sans-serif' ),
// Devanagari.
'bn-BD' => array( 'Arial', 'sans-serif' ),
'hi-IN' => array( 'Arial', 'sans-serif' ),
'mr' => array( 'Arial', 'sans-serif' ),
'ne-NP' => array( 'Arial', 'sans-serif' ),
// Greek.
'el' => array( '\'Helvetica Neue\', Helvetica, Arial, sans-serif' ),
// Gujarati.
'gu' => array( 'Arial', 'sans-serif' ),
// Hebrew.
'he-IL' => array( '\'Arial Hebrew\'', 'Arial', 'sans-serif' ),
// Japanese.
'ja' => array( 'sans-serif' ),
// Korean.
'ko-KR' => array( '\'Apple SD Gothic Neo\'', '\'Malgun Gothic\'', '\'Nanum Gothic\'', 'Dotum', 'sans-serif' ),
// Thai.
'th' => array( '\'Sukhumvit Set\'', '\'Helvetica Neue\'', 'Helvetica', 'Arial', 'sans-serif' ),
// Vietnamese.
'vi' => array( '\'Libre Franklin\'', 'sans-serif' ),
)
);
// Return if the selected language has no fallback fonts.
if ( empty( $font_family[ $locale ] ) ) {
return;
}
// Define elements to apply fallback fonts to.
$elements = apply_filters(
'twentytwenty_get_localized_font_family_elements',
array(
'front-end' => array( 'body', 'input', 'textarea', 'button', '.button', '.faux-button', '.wp-block-button__link', '.wp-block-file__button', '.has-drop-cap:not(:focus)::first-letter', '.has-drop-cap:not(:focus)::first-letter', '.entry-content .wp-block-archives', '.entry-content .wp-block-categories', '.entry-content .wp-block-cover-image', '.entry-content .wp-block-latest-comments', '.entry-content .wp-block-latest-posts', '.entry-content .wp-block-pullquote', '.entry-content .wp-block-quote.is-large', '.entry-content .wp-block-quote.is-style-large', '.entry-content .wp-block-archives *', '.entry-content .wp-block-categories *', '.entry-content .wp-block-latest-posts *', '.entry-content .wp-block-latest-comments *', '.entry-content p', '.entry-content ol', '.entry-content ul', '.entry-content dl', '.entry-content dt', '.entry-content cite', '.entry-content figcaption', '.entry-content .wp-caption-text', '.comment-content p', '.comment-content ol', '.comment-content ul', '.comment-content dl', '.comment-content dt', '.comment-content cite', '.comment-content figcaption', '.comment-content .wp-caption-text', '.widget_text p', '.widget_text ol', '.widget_text ul', '.widget_text dl', '.widget_text dt', '.widget-content .rssSummary', '.widget-content cite', '.widget-content figcaption', '.widget-content .wp-caption-text' ),
'block-editor' => array( '.editor-styles-wrapper > *', '.editor-styles-wrapper p', '.editor-styles-wrapper ol', '.editor-styles-wrapper ul', '.editor-styles-wrapper dl', '.editor-styles-wrapper dt', '.editor-post-title__block .editor-post-title__input', '.editor-styles-wrapper .wp-block h1', '.editor-styles-wrapper .wp-block h2', '.editor-styles-wrapper .wp-block h3', '.editor-styles-wrapper .wp-block h4', '.editor-styles-wrapper .wp-block h5', '.editor-styles-wrapper .wp-block h6', '.editor-styles-wrapper .has-drop-cap:not(:focus)::first-letter', '.editor-styles-wrapper cite', '.editor-styles-wrapper figcaption', '.editor-styles-wrapper .wp-caption-text' ),
'classic-editor' => array( 'body#tinymce.wp-editor', 'body#tinymce.wp-editor p', 'body#tinymce.wp-editor ol', 'body#tinymce.wp-editor ul', 'body#tinymce.wp-editor dl', 'body#tinymce.wp-editor dt', 'body#tinymce.wp-editor figcaption', 'body#tinymce.wp-editor .wp-caption-text', 'body#tinymce.wp-editor .wp-caption-dd', 'body#tinymce.wp-editor cite', 'body#tinymce.wp-editor table' ),
)
);
// Return if the specified type doesn't exist.
if ( empty( $elements[ $type ] ) ) {
return;
}
// Return the specified styles.
return twentytwenty_generate_css( implode( ',', $elements[ $type ] ), 'font-family', implode( ',', $font_family[ $locale ] ), null, null, false );
}
}
}

View File

@ -0,0 +1,47 @@
<?php
/**
* Javascript Loader Class
*
* Allow `async` and `defer` while enqueuing Javascript.
*
* Based on a solution in WP Rig.
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
if ( ! class_exists( 'TwentyTwenty_Script_Loader' ) ) {
/**
* A class that provides a way to add `async` or `defer` attributes to scripts.
*/
class TwentyTwenty_Script_Loader {
/**
* Adds async/defer attributes to enqueued / registered scripts.
*
* If #12009 lands in WordPress, this function can no-op since it would be handled in core.
*
* @link https://core.trac.wordpress.org/ticket/12009
*
* @param string $tag The script tag.
* @param string $handle The script handle.
* @return string Script HTML string.
*/
public function filter_script_loader_tag( $tag, $handle ) {
foreach ( array( 'async', 'defer' ) as $attr ) {
if ( ! wp_scripts()->get_data( $handle, $attr ) ) {
continue;
}
// Prevent adding attribute when already added in #12009.
if ( ! preg_match( ":\s$attr(=|>|\s):", $tag ) ) {
$tag = preg_replace( ':(?=></script>):', " $attr", $tag, 1 );
}
// Only allow async or defer, not both.
break;
}
return $tag;
}
}
}

View File

@ -0,0 +1,26 @@
<?php
/**
* Customizer Separator Control settings for this theme.
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
if ( class_exists( 'WP_Customize_Control' ) ) {
if ( ! class_exists( 'TwentyTwenty_Separator_Control' ) ) {
/**
* Separator Control.
*/
class TwentyTwenty_Separator_Control extends WP_Customize_Control {
/**
* Render the hr.
*/
public function render_content() {
echo '<hr/>';
}
}
}
}

View File

@ -0,0 +1,262 @@
<?php
/**
* Custom icons for this theme.
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
if ( ! class_exists( 'TwentyTwenty_SVG_Icons' ) ) {
/**
* SVG ICONS CLASS
* Retrieve the SVG code for the specified icon. Based on a solution in Twenty Nineteen.
*/
class TwentyTwenty_SVG_Icons {
/**
* GET SVG CODE
* Get the SVG code for the specified icon
*
* @param string $icon Icon name.
* @param string $group Icon group.
* @param string $color Color.
*/
public static function get_svg( $icon, $group = 'ui', $color = '#1A1A1B' ) {
if ( 'ui' === $group ) {
$arr = self::$ui_icons;
} elseif ( 'social' === $group ) {
$arr = self::$social_icons;
} else {
$arr = array();
}
if ( array_key_exists( $icon, $arr ) ) {
$repl = '<svg class="svg-icon" aria-hidden="true" role="img" focusable="false" ';
$svg = preg_replace( '/^<svg /', $repl, trim( $arr[ $icon ] ) ); // Add extra attributes to SVG code.
$svg = str_replace( '#1A1A1B', $color, $svg ); // Replace the color.
$svg = str_replace( '#', '%23', $svg ); // Urlencode hashes.
$svg = preg_replace( "/([\n\t]+)/", ' ', $svg ); // Remove newlines & tabs.
$svg = preg_replace( '/>\s*</', '><', $svg ); // Remove whitespace between SVG tags.
return $svg;
}
return null;
}
/**
* GET SOCIAL LINK SVG
* Detects the social network from a URL and returns the SVG code for its icon.
*
* @param string $uri The URL to retrieve SVG for.
*/
public static function get_social_link_svg( $uri ) {
static $regex_map; // Only compute regex map once, for performance.
if ( ! isset( $regex_map ) ) {
$regex_map = array();
$map = &self::$social_icons_map; // Use reference instead of copy, to save memory.
foreach ( array_keys( self::$social_icons ) as $icon ) {
$domains = array_key_exists( $icon, $map ) ? $map[ $icon ] : array( sprintf( '%s.com', $icon ) );
$domains = array_map( 'trim', $domains ); // Remove leading/trailing spaces, to prevent regex from failing to match.
$domains = array_map( 'preg_quote', $domains );
$regex_map[ $icon ] = sprintf( '/(%s)/i', implode( '|', $domains ) );
}
}
foreach ( $regex_map as $icon => $regex ) {
if ( preg_match( $regex, $uri ) ) {
return twentytwenty_get_theme_svg( $icon, 'social' );
}
}
return null;
}
/**
* ICON STORAGE
* Store the code for all SVGs in an array.
*
* @var array
*/
public static $ui_icons = array(
'arrow-down' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="24" viewBox="0 0 22 24">
<polygon fill="#FFF" points="721.105 856 721.105 874.315 728.083 867.313 730.204 869.41 719.59 880 709 869.41 711.074 867.313 718.076 874.315 718.076 856" transform="translate(-709 -856)"/>
</svg>',
'arrow-down-circled' => '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
<path fill="#FFF" fill-rule="evenodd" d="M16,32 C7.163444,32 0,24.836556 0,16 C0,7.163444 7.163444,0 16,0 C24.836556,0 32,7.163444 32,16 C32,24.836556 24.836556,32 16,32 Z M16.7934656,8 L15.4886113,8 L15.4886113,21.5300971 L10.082786,16.1242718 L9.18181515,17.0407767 L16.1410384,24 L23.1157957,17.0407767 L22.1915239,16.1242718 L16.7934656,21.5300971 L16.7934656,8 Z"/>
</svg>',
'bookmark' => '<svg xmlns="http://www.w3.org/2000/svg" width="15" height="18" viewBox="0 0 15 18">
<path d="M12.598889,2.699762 C12.598889,2.20275 12.195981,1.799841 11.698969,1.799841 L2.699762,1.799841 C2.20275,1.799841 1.799841,2.20275 1.799841,2.699762 L1.799841,15.349777 L6.676297,11.866594 C6.989197,11.643094 7.409533,11.643094 7.722434,11.866594 L12.598889,15.349777 L12.598889,2.699762 Z M1.422989,17.830788 C0.82736,18.256238 0,17.830464 0,17.098493 L0,2.699762 C0,1.208725 1.208725,0 2.699762,0 L11.698969,0 C13.190006,0 14.398731,1.208725 14.398731,2.699762 L14.398731,17.098493 C14.398731,17.830464 13.571371,18.256238 12.975742,17.830788 L7.199365,13.704805 L1.422989,17.830788 Z"/>
</svg>',
'calendar' => '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19">
<path fill="#1A1A1B" d="M4.60069444,4.09375 L3.25,4.09375 C2.47334957,4.09375 1.84375,4.72334957 1.84375,5.5 L1.84375,7.26736111 L16.15625,7.26736111 L16.15625,5.5 C16.15625,4.72334957 15.5266504,4.09375 14.75,4.09375 L13.3993056,4.09375 L13.3993056,4.55555556 C13.3993056,5.02154581 13.0215458,5.39930556 12.5555556,5.39930556 C12.0895653,5.39930556 11.7118056,5.02154581 11.7118056,4.55555556 L11.7118056,4.09375 L6.28819444,4.09375 L6.28819444,4.55555556 C6.28819444,5.02154581 5.9104347,5.39930556 5.44444444,5.39930556 C4.97845419,5.39930556 4.60069444,5.02154581 4.60069444,4.55555556 L4.60069444,4.09375 Z M6.28819444,2.40625 L11.7118056,2.40625 L11.7118056,1 C11.7118056,0.534009742 12.0895653,0.15625 12.5555556,0.15625 C13.0215458,0.15625 13.3993056,0.534009742 13.3993056,1 L13.3993056,2.40625 L14.75,2.40625 C16.4586309,2.40625 17.84375,3.79136906 17.84375,5.5 L17.84375,15.875 C17.84375,17.5836309 16.4586309,18.96875 14.75,18.96875 L3.25,18.96875 C1.54136906,18.96875 0.15625,17.5836309 0.15625,15.875 L0.15625,5.5 C0.15625,3.79136906 1.54136906,2.40625 3.25,2.40625 L4.60069444,2.40625 L4.60069444,1 C4.60069444,0.534009742 4.97845419,0.15625 5.44444444,0.15625 C5.9104347,0.15625 6.28819444,0.534009742 6.28819444,1 L6.28819444,2.40625 Z M1.84375,8.95486111 L1.84375,15.875 C1.84375,16.6516504 2.47334957,17.28125 3.25,17.28125 L14.75,17.28125 C15.5266504,17.28125 16.15625,16.6516504 16.15625,15.875 L16.15625,8.95486111 L1.84375,8.95486111 Z"/>
</svg>',
'chevron-down' => '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="12" viewBox="0 0 20 12">
<polygon fill="#1A1A1B" fill-rule="evenodd" points="1319.899 365.778 1327.678 358 1329.799 360.121 1319.899 370.021 1310 360.121 1312.121 358" transform="translate(-1310 -358)"/>
</svg>',
'comment' => '<svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" viewBox="0 0 19 19">
<path d="M9.43016863,13.2235931 C9.58624731,13.094699 9.7823475,13.0241935 9.98476849,13.0241935 L15.0564516,13.0241935 C15.8581553,13.0241935 16.5080645,12.3742843 16.5080645,11.5725806 L16.5080645,3.44354839 C16.5080645,2.64184472 15.8581553,1.99193548 15.0564516,1.99193548 L3.44354839,1.99193548 C2.64184472,1.99193548 1.99193548,2.64184472 1.99193548,3.44354839 L1.99193548,11.5725806 C1.99193548,12.3742843 2.64184472,13.0241935 3.44354839,13.0241935 L5.76612903,13.0241935 C6.24715123,13.0241935 6.63709677,13.4141391 6.63709677,13.8951613 L6.63709677,15.5301903 L9.43016863,13.2235931 Z M3.44354839,14.766129 C1.67980032,14.766129 0.25,13.3363287 0.25,11.5725806 L0.25,3.44354839 C0.25,1.67980032 1.67980032,0.25 3.44354839,0.25 L15.0564516,0.25 C16.8201997,0.25 18.25,1.67980032 18.25,3.44354839 L18.25,11.5725806 C18.25,13.3363287 16.8201997,14.766129 15.0564516,14.766129 L10.2979143,14.766129 L6.32072889,18.0506004 C5.75274472,18.5196577 4.89516129,18.1156602 4.89516129,17.3790323 L4.89516129,14.766129 L3.44354839,14.766129 Z"/>
</svg>',
'cross' => '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<polygon fill="#1A1A1B" fill-rule="evenodd" points="6.852 7.649 .399 1.195 1.445 .149 7.899 6.602 14.352 .149 15.399 1.195 8.945 7.649 15.399 14.102 14.352 15.149 7.899 8.695 1.445 15.149 .399 14.102"/>
</svg>',
'ellipsis' => '<svg xmlns="http://www.w3.org/2000/svg" width="26" height="7" viewBox="0 0 26 7">
<path fill-rule="evenodd" d="M332.5,45 C330.567003,45 329,43.4329966 329,41.5 C329,39.5670034 330.567003,38 332.5,38 C334.432997,38 336,39.5670034 336,41.5 C336,43.4329966 334.432997,45 332.5,45 Z M342,45 C340.067003,45 338.5,43.4329966 338.5,41.5 C338.5,39.5670034 340.067003,38 342,38 C343.932997,38 345.5,39.5670034 345.5,41.5 C345.5,43.4329966 343.932997,45 342,45 Z M351.5,45 C349.567003,45 348,43.4329966 348,41.5 C348,39.5670034 349.567003,38 351.5,38 C353.432997,38 355,39.5670034 355,41.5 C355,43.4329966 353.432997,45 351.5,45 Z" transform="translate(-329 -38)"/>
</svg>',
'edit' => '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18">
<path fill="#1A1A1B" d="M14.7272727,11.1763636 C14.7272727,10.7244943 15.0935852,10.3581818 15.5454545,10.3581818 C15.9973239,10.3581818 16.3636364,10.7244943 16.3636364,11.1763636 L16.3636364,15.5454545 C16.3636364,16.9010626 15.2646989,18 13.9090909,18 L2.45454545,18 C1.09893743,18 0,16.9010626 0,15.5454545 L0,4.09090909 C0,2.73530107 1.09893743,1.63636364 2.45454545,1.63636364 L6.82363636,1.63636364 C7.2755057,1.63636364 7.64181818,2.00267611 7.64181818,2.45454545 C7.64181818,2.9064148 7.2755057,3.27272727 6.82363636,3.27272727 L2.45454545,3.27272727 C2.00267611,3.27272727 1.63636364,3.63903975 1.63636364,4.09090909 L1.63636364,15.5454545 C1.63636364,15.9973239 2.00267611,16.3636364 2.45454545,16.3636364 L13.9090909,16.3636364 C14.3609602,16.3636364 14.7272727,15.9973239 14.7272727,15.5454545 L14.7272727,11.1763636 Z M6.54545455,9.33890201 L6.54545455,11.4545455 L8.66109799,11.4545455 L16.0247344,4.09090909 L13.9090909,1.97526564 L6.54545455,9.33890201 Z M14.4876328,0.239639906 L17.7603601,3.51236718 C18.07988,3.83188705 18.07988,4.34993113 17.7603601,4.669451 L9.57854191,12.8512692 C9.42510306,13.004708 9.21699531,13.0909091 9,13.0909091 L5.72727273,13.0909091 C5.27540339,13.0909091 4.90909091,12.7245966 4.90909091,12.2727273 L4.90909091,9 C4.90909091,8.78300469 4.99529196,8.57489694 5.14873082,8.42145809 L13.330549,0.239639906 C13.6500689,-0.0798799688 14.1681129,-0.0798799688 14.4876328,0.239639906 Z"/>
</svg>',
'folder' => '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="19" viewBox="0 0 20 19">
<path fill="#1A1A1B" d="M2.8,1.85 C2.275329,1.85 1.85,2.27532949 1.85,2.8 L1.85,15.4 C1.85,15.9246705 2.275329,16.35 2.8,16.35 L17.2,16.35 C17.724671,16.35 18.15,15.9246705 18.15,15.4 L18.15,5.5 C18.15,4.97532949 17.724671,4.55 17.2,4.55 L9.1,4.55 C8.8158,4.55 8.550403,4.40796403 8.392757,4.17149517 L6.845094,1.85 L2.8,1.85 Z M17.2,2.85 C18.663555,2.85 19.85,4.03644541 19.85,5.5 L19.85,15.4 C19.85,16.8635546 18.663555,18.05 17.2,18.05 L2.8,18.05 C1.336445,18.05 0.15,16.8635546 0.15,15.4 L0.15,2.8 C0.15,1.33644541 1.336445,0.15 2.8,0.15 L7.3,0.15 C7.5842,0.15 7.849597,0.292035965 8.007243,0.528504833 L9.554906,2.85 L17.2,2.85 Z"/>
</svg>',
'link' => '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18">
<path d="M6.70846497,10.3082552 C6.43780491,9.94641406 6.5117218,9.43367048 6.87356298,9.16301045 C7.23540415,8.89235035 7.74814771,8.96626726 8.01880776,9.32810842 C8.5875786,10.0884893 9.45856383,10.5643487 10.4057058,10.6321812 C11.3528479,10.7000136 12.2827563,10.3531306 12.9541853,9.68145807 L15.3987642,7.23705399 C16.6390369,5.9529049 16.6212992,3.91168563 15.3588977,2.6492841 C14.0964962,1.38688258 12.0552769,1.36914494 10.77958,2.60113525 L9.37230725,4.00022615 C9.05185726,4.31881314 8.53381538,4.31730281 8.21522839,3.99685275 C7.89664141,3.67640269 7.89815174,3.15836082 8.21860184,2.83977385 L9.63432671,1.43240056 C11.5605503,-0.42800847 14.6223793,-0.401402004 16.5159816,1.49220028 C18.4095838,3.38580256 18.4361903,6.44763148 16.5658147,8.38399647 L14.1113741,10.838437 C13.1043877,11.8457885 11.7095252,12.366113 10.2888121,12.2643643 C8.86809903,12.1626156 7.56162126,11.4488264 6.70846497,10.3082552 Z M11.291535,7.6917448 C11.5621951,8.05358597 11.4882782,8.56632952 11.126437,8.83698955 C10.7645959,9.10764965 10.2518523,9.03373274 9.98119227,8.67189158 C9.4124214,7.91151075 8.54143617,7.43565129 7.59429414,7.36781884 C6.6471521,7.29998638 5.71724372,7.64686937 5.04581464,8.31854193 L2.60123581,10.762946 C1.36096312,12.0470951 1.37870076,14.0883144 2.64110228,15.3507159 C3.90350381,16.6131174 5.94472309,16.630855 7.21873082,15.400549 L8.61782171,14.0014581 C8.93734159,13.6819382 9.45538568,13.6819382 9.77490556,14.0014581 C10.0944254,14.320978 10.0944254,14.839022 9.77490556,15.1585419 L8.36567329,16.5675994 C6.43944966,18.4280085 3.37762074,18.401402 1.48401846,16.5077998 C-0.409583822,14.6141975 -0.436190288,11.5523685 1.43418536,9.61600353 L3.88862594,7.16156298 C4.89561225,6.15421151 6.29047483,5.63388702 7.71118789,5.7356357 C9.13190097,5.83738438 10.4383788,6.55117356 11.291535,7.6917448 Z"/>
</svg>',
'search' => '<svg xmlns="http://www.w3.org/2000/svg" width="23" height="23" viewBox="0 0 23 23">
<path d="M38.710696,48.0601792 L43,52.3494831 L41.3494831,54 L37.0601792,49.710696 C35.2632422,51.1481185 32.9839107,52.0076499 30.5038249,52.0076499 C24.7027226,52.0076499 20,47.3049272 20,41.5038249 C20,35.7027226 24.7027226,31 30.5038249,31 C36.3049272,31 41.0076499,35.7027226 41.0076499,41.5038249 C41.0076499,43.9839107 40.1481185,46.2632422 38.710696,48.0601792 Z M36.3875844,47.1716785 C37.8030221,45.7026647 38.6734666,43.7048964 38.6734666,41.5038249 C38.6734666,36.9918565 35.0157934,33.3341833 30.5038249,33.3341833 C25.9918565,33.3341833 22.3341833,36.9918565 22.3341833,41.5038249 C22.3341833,46.0157934 25.9918565,49.6734666 30.5038249,49.6734666 C32.7048964,49.6734666 34.7026647,48.8030221 36.1716785,47.3875844 C36.2023931,47.347638 36.2360451,47.3092237 36.2726343,47.2726343 C36.3092237,47.2360451 36.347638,47.2023931 36.3875844,47.1716785 Z" transform="translate(-20 -31)"/>
</svg>',
'tag' => '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18">
<path fill="#1A1A1B" d="M15.4496399,8.42490555 L8.66109799,1.63636364 L1.63636364,1.63636364 L1.63636364,8.66081885 L8.42522727,15.44178 C8.57869221,15.5954158 8.78693789,15.6817418 9.00409091,15.6817418 C9.22124393,15.6817418 9.42948961,15.5954158 9.58327627,15.4414581 L15.4486339,9.57610048 C15.7651495,9.25692435 15.7649133,8.74206554 15.4496399,8.42490555 Z M16.6084423,10.7304545 L10.7406818,16.59822 C10.280287,17.0591273 9.65554997,17.3181054 9.00409091,17.3181054 C8.35263185,17.3181054 7.72789481,17.0591273 7.26815877,16.5988788 L0.239976954,9.57887876 C0.0863319284,9.4254126 0,9.21716044 0,9 L0,0.818181818 C0,0.366312477 0.366312477,0 0.818181818,0 L9,0 C9.21699531,0 9.42510306,0.0862010512 9.57854191,0.239639906 L16.6084423,7.26954545 C17.5601275,8.22691012 17.5601275,9.77308988 16.6084423,10.7304545 Z M5,6 C4.44771525,6 4,5.55228475 4,5 C4,4.44771525 4.44771525,4 5,4 C5.55228475,4 6,4.44771525 6,5 C6,5.55228475 5.55228475,6 5,6 Z"/>
</svg>',
'user' => '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="20" viewBox="0 0 18 20">
<path fill="#1A1A1B" d="M18,19 C18,19.5522847 17.5522847,20 17,20 C16.4477153,20 16,19.5522847 16,19 L16,17 C16,15.3431458 14.6568542,14 13,14 L5,14 C3.34314575,14 2,15.3431458 2,17 L2,19 C2,19.5522847 1.55228475,20 1,20 C0.44771525,20 0,19.5522847 0,19 L0,17 C0,14.2385763 2.23857625,12 5,12 L13,12 C15.7614237,12 18,14.2385763 18,17 L18,19 Z M9,10 C6.23857625,10 4,7.76142375 4,5 C4,2.23857625 6.23857625,0 9,0 C11.7614237,0 14,2.23857625 14,5 C14,7.76142375 11.7614237,10 9,10 Z M9,8 C10.6568542,8 12,6.65685425 12,5 C12,3.34314575 10.6568542,2 9,2 C7.34314575,2 6,3.34314575 6,5 C6,6.65685425 7.34314575,8 9,8 Z"/>
</svg>',
);
/**
* Social Icons domain mappings.
*
* By default, each Icon ID is matched against a .com TLD. To override this behavior,
* specify all the domains it covers (including the .com TLD too, if applicable).
*
* @var array
*/
public static $social_icons_map = array(
'amazon' => array(
'amazon.com',
'amazon.cn',
'amazon.in',
'amazon.fr',
'amazon.de',
'amazon.it',
'amazon.nl',
'amazon.es',
'amazon.co',
'amazon.ca',
),
'behance' => array(
'behance.net',
),
'codepen' => array(
'codepen.io',
),
'facebook' => array(
'facebook.com',
'fb.me',
),
'feed' => array(
'feed',
),
'lastfm' => array(
'last.fm',
),
'mail' => array(
'mailto:',
),
'pocket' => array(
'getpocket.com',
),
'twitch' => array(
'twitch.tv',
),
'wordpress' => array(
'wordpress.com',
'wordpress.org',
),
);
/**
* Social Icons svg sources.
*
* @var array
*/
public static $social_icons = array(
'500px' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M6.94026,15.1412c.00437.01213.108.29862.168.44064a6.55008,6.55008,0,1,0,6.03191-9.09557,6.68654,6.68654,0,0,0-2.58357.51467A8.53914,8.53914,0,0,0,8.21268,8.61344L8.209,8.61725V3.22948l9.0504-.00008c.32934-.0036.32934-.46353.32934-.61466s0-.61091-.33035-.61467L7.47248,2a.43.43,0,0,0-.43131.42692v7.58355c0,.24466.30476.42131.58793.4819.553.11812.68074-.05864.81617-.2457l.018-.02481A10.52673,10.52673,0,0,1,9.32258,9.258a5.35268,5.35268,0,1,1,7.58985,7.54976,5.417,5.417,0,0,1-3.80867,1.56365,5.17483,5.17483,0,0,1-2.69822-.74478l.00342-4.61111a2.79372,2.79372,0,0,1,.71372-1.78792,2.61611,2.61611,0,0,1,1.98282-.89477,2.75683,2.75683,0,0,1,1.95525.79477,2.66867,2.66867,0,0,1,.79656,1.909,2.724,2.724,0,0,1-2.75849,2.748,4.94651,4.94651,0,0,1-.86254-.13719c-.31234-.093-.44519.34058-.48892.48349-.16811.54966.08453.65862.13687.67489a3.75751,3.75751,0,0,0,1.25234.18375,3.94634,3.94634,0,1,0-2.82444-6.742,3.67478,3.67478,0,0,0-1.13028,2.584l-.00041.02323c-.0035.11667-.00579,2.881-.00644,3.78811l-.00407-.00451a6.18521,6.18521,0,0,1-1.0851-1.86092c-.10544-.27856-.34358-.22925-.66857-.12917-.14192.04372-.57386.17677-.47833.489Zm4.65165-1.08338a.51346.51346,0,0,0,.19513.31818l.02276.022a.52945.52945,0,0,0,.3517.18416.24242.24242,0,0,0,.16577-.0611c.05473-.05082.67382-.67812.73287-.738l.69041.68819a.28978.28978,0,0,0,.21437.11032.53239.53239,0,0,0,.35708-.19486c.29792-.30419.14885-.46821.07676-.54751l-.69954-.69975.72952-.73469c.16-.17311.01874-.35708-.12218-.498-.20461-.20461-.402-.25742-.52855-.14083l-.7254.72665-.73354-.73375a.20128.20128,0,0,0-.14179-.05695.54135.54135,0,0,0-.34379.19648c-.22561.22555-.274.38149-.15656.5059l.73374.7315-.72942.73072A.26589.26589,0,0,0,11.59191,14.05782Zm1.59866-9.915A8.86081,8.86081,0,0,0,9.854,4.776a.26169.26169,0,0,0-.16938.22759.92978.92978,0,0,0,.08619.42094c.05682.14524.20779.531.50006.41955a8.40969,8.40969,0,0,1,2.91968-.55484,7.87875,7.87875,0,0,1,3.086.62286,8.61817,8.61817,0,0,1,2.30562,1.49315.2781.2781,0,0,0,.18318.07586c.15529,0,.30425-.15253.43167-.29551.21268-.23861.35873-.4369.1492-.63538a8.50425,8.50425,0,0,0-2.62312-1.694A9.0177,9.0177,0,0,0,13.19058,4.14283ZM19.50945,18.6236h0a.93171.93171,0,0,0-.36642-.25406.26589.26589,0,0,0-.27613.06613l-.06943.06929A7.90606,7.90606,0,0,1,7.60639,18.505a7.57284,7.57284,0,0,1-1.696-2.51537,8.58715,8.58715,0,0,1-.5147-1.77754l-.00871-.04864c-.04939-.25873-.28755-.27684-.62981-.22448-.14234.02178-.5755.088-.53426.39969l.001.00712a9.08807,9.08807,0,0,0,15.406,4.99094c.00193-.00192.04753-.04718.0725-.07436C19.79425,19.16234,19.87422,18.98728,19.50945,18.6236Z"></path></svg>',
'amazon' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M13.582,8.182C11.934,8.367,9.78,8.49,8.238,9.166c-1.781,0.769-3.03,2.337-3.03,4.644 c0,2.953,1.86,4.429,4.253,4.429c2.02,0,3.125-0.477,4.685-2.065c0.516,0.747,0.685,1.109,1.629,1.894 c0.212,0.114,0.483,0.103,0.672-0.066l0.006,0.006c0.567-0.505,1.599-1.401,2.18-1.888c0.231-0.188,0.19-0.496,0.009-0.754 c-0.52-0.718-1.072-1.303-1.072-2.634V8.305c0-1.876,0.133-3.599-1.249-4.891C15.23,2.369,13.422,2,12.04,2 C9.336,2,6.318,3.01,5.686,6.351C5.618,6.706,5.877,6.893,6.109,6.945l2.754,0.298C9.121,7.23,9.308,6.977,9.357,6.72 c0.236-1.151,1.2-1.706,2.284-1.706c0.584,0,1.249,0.215,1.595,0.738c0.398,0.584,0.346,1.384,0.346,2.061V8.182z M13.049,14.088 c-0.451,0.8-1.169,1.291-1.967,1.291c-1.09,0-1.728-0.83-1.728-2.061c0-2.42,2.171-2.86,4.227-2.86v0.615 C13.582,12.181,13.608,13.104,13.049,14.088z M20.683,19.339C18.329,21.076,14.917,22,11.979,22c-4.118,0-7.826-1.522-10.632-4.057 c-0.22-0.199-0.024-0.471,0.241-0.317c3.027,1.762,6.771,2.823,10.639,2.823c2.608,0,5.476-0.541,8.115-1.66 C20.739,18.62,21.072,19.051,20.683,19.339z M21.336,21.043c-0.194,0.163-0.379,0.076-0.293-0.139 c0.284-0.71,0.92-2.298,0.619-2.684c-0.301-0.386-1.99-0.183-2.749-0.092c-0.23,0.027-0.266-0.173-0.059-0.319 c1.348-0.946,3.555-0.673,3.811-0.356C22.925,17.773,22.599,19.986,21.336,21.043z"></path></svg>',
'bandcamp' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M15.27 17.289 3 17.289 8.73 6.711 21 6.711 15.27 17.289"></path></svg>',
'behance' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M7.799,5.698c0.589,0,1.12,0.051,1.606,0.156c0.482,0.102,0.894,0.273,1.241,0.507c0.344,0.235,0.612,0.546,0.804,0.938 c0.188,0.387,0.281,0.871,0.281,1.443c0,0.619-0.141,1.137-0.421,1.551c-0.284,0.413-0.7,0.751-1.255,1.014 c0.756,0.218,1.317,0.601,1.689,1.146c0.374,0.549,0.557,1.205,0.557,1.975c0,0.623-0.12,1.161-0.359,1.612 c-0.241,0.457-0.569,0.828-0.973,1.114c-0.408,0.288-0.876,0.5-1.399,0.637C9.052,17.931,8.514,18,7.963,18H2V5.698H7.799 M7.449,10.668c0.481,0,0.878-0.114,1.192-0.345c0.311-0.228,0.463-0.603,0.463-1.119c0-0.286-0.051-0.523-0.152-0.707 C8.848,8.315,8.711,8.171,8.536,8.07C8.362,7.966,8.166,7.894,7.94,7.854c-0.224-0.044-0.457-0.06-0.697-0.06H4.709v2.874H7.449z M7.6,15.905c0.267,0,0.521-0.024,0.759-0.077c0.243-0.053,0.457-0.137,0.637-0.261c0.182-0.12,0.332-0.283,0.441-0.491 C9.547,14.87,9.6,14.602,9.6,14.278c0-0.633-0.18-1.084-0.533-1.357c-0.356-0.27-0.83-0.404-1.413-0.404H4.709v3.388L7.6,15.905z M16.162,15.864c0.367,0.358,0.897,0.538,1.583,0.538c0.493,0,0.92-0.125,1.277-0.374c0.354-0.248,0.571-0.514,0.654-0.79h2.155 c-0.347,1.072-0.872,1.838-1.589,2.299C19.534,18,18.67,18.23,17.662,18.23c-0.701,0-1.332-0.113-1.899-0.337 c-0.567-0.227-1.041-0.544-1.439-0.958c-0.389-0.415-0.689-0.907-0.904-1.484c-0.213-0.574-0.32-1.21-0.32-1.899 c0-0.666,0.11-1.288,0.329-1.863c0.222-0.577,0.529-1.075,0.933-1.492c0.406-0.42,0.885-0.751,1.444-0.994 c0.558-0.241,1.175-0.363,1.857-0.363c0.754,0,1.414,0.145,1.98,0.44c0.563,0.291,1.026,0.686,1.389,1.181 c0.363,0.493,0.622,1.057,0.783,1.69c0.16,0.632,0.217,1.292,0.171,1.983h-6.428C15.557,14.84,15.795,15.506,16.162,15.864 M18.973,11.184c-0.291-0.321-0.783-0.496-1.384-0.496c-0.39,0-0.714,0.066-0.973,0.2c-0.254,0.132-0.461,0.297-0.621,0.491 c-0.157,0.197-0.265,0.405-0.328,0.628c-0.063,0.217-0.101,0.413-0.111,0.587h3.98C19.478,11.969,19.265,11.509,18.973,11.184z M15.057,7.738h4.985V6.524h-4.985L15.057,7.738z"></path></svg>',
'codepen' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M22.016,8.84c-0.002-0.013-0.005-0.025-0.007-0.037c-0.005-0.025-0.008-0.048-0.015-0.072 c-0.003-0.015-0.01-0.028-0.013-0.042c-0.008-0.02-0.015-0.04-0.023-0.062c-0.007-0.015-0.013-0.028-0.02-0.042 c-0.008-0.02-0.018-0.037-0.03-0.057c-0.007-0.013-0.017-0.027-0.025-0.038c-0.012-0.018-0.023-0.035-0.035-0.052 c-0.01-0.013-0.02-0.025-0.03-0.037c-0.015-0.017-0.028-0.032-0.043-0.045c-0.01-0.012-0.022-0.023-0.035-0.035 c-0.015-0.015-0.032-0.028-0.048-0.04c-0.012-0.01-0.025-0.02-0.037-0.03c-0.005-0.003-0.01-0.008-0.015-0.012l-9.161-6.096 c-0.289-0.192-0.666-0.192-0.955,0L2.359,8.237C2.354,8.24,2.349,8.245,2.344,8.249L2.306,8.277 c-0.017,0.013-0.033,0.027-0.048,0.04C2.246,8.331,2.234,8.342,2.222,8.352c-0.015,0.015-0.028,0.03-0.042,0.047 c-0.012,0.013-0.022,0.023-0.03,0.037C2.139,8.453,2.125,8.471,2.115,8.488C2.107,8.501,2.099,8.514,2.09,8.526 C2.079,8.548,2.069,8.565,2.06,8.585C2.054,8.6,2.047,8.613,2.04,8.626C2.032,8.648,2.025,8.67,2.019,8.69 c-0.005,0.013-0.01,0.027-0.013,0.042C1.999,8.755,1.995,8.778,1.99,8.803C1.989,8.817,1.985,8.828,1.984,8.84 C1.978,8.879,1.975,8.915,1.975,8.954v6.093c0,0.037,0.003,0.075,0.008,0.112c0.002,0.012,0.005,0.025,0.007,0.038 c0.005,0.023,0.008,0.047,0.015,0.072c0.003,0.015,0.008,0.028,0.013,0.04c0.007,0.022,0.013,0.042,0.022,0.063 c0.007,0.015,0.013,0.028,0.02,0.04c0.008,0.02,0.018,0.038,0.03,0.058c0.007,0.013,0.015,0.027,0.025,0.038 c0.012,0.018,0.023,0.035,0.035,0.052c0.01,0.013,0.02,0.025,0.03,0.037c0.013,0.015,0.028,0.032,0.042,0.045 c0.012,0.012,0.023,0.023,0.035,0.035c0.015,0.013,0.032,0.028,0.048,0.04l0.038,0.03c0.005,0.003,0.01,0.007,0.013,0.01 l9.163,6.095C11.668,21.953,11.833,22,12,22c0.167,0,0.332-0.047,0.478-0.144l9.163-6.095l0.015-0.01 c0.013-0.01,0.027-0.02,0.037-0.03c0.018-0.013,0.035-0.028,0.048-0.04c0.013-0.012,0.025-0.023,0.035-0.035 c0.017-0.015,0.03-0.032,0.043-0.045c0.01-0.013,0.02-0.025,0.03-0.037c0.013-0.018,0.025-0.035,0.035-0.052 c0.008-0.013,0.018-0.027,0.025-0.038c0.012-0.02,0.022-0.038,0.03-0.058c0.007-0.013,0.013-0.027,0.02-0.04 c0.008-0.022,0.015-0.042,0.023-0.063c0.003-0.013,0.01-0.027,0.013-0.04c0.007-0.025,0.01-0.048,0.015-0.072 c0.002-0.013,0.005-0.027,0.007-0.037c0.003-0.042,0.007-0.079,0.007-0.117V8.954C22.025,8.915,22.022,8.879,22.016,8.84z M12.862,4.464l6.751,4.49l-3.016,2.013l-3.735-2.492V4.464z M11.138,4.464v4.009l-3.735,2.494L4.389,8.954L11.138,4.464z M3.699,10.562L5.853,12l-2.155,1.438V10.562z M11.138,19.536l-6.749-4.491l3.015-2.011l3.735,2.492V19.536z M12,14.035L8.953,12 L12,9.966L15.047,12L12,14.035z M12.862,19.536v-4.009l3.735-2.492l3.016,2.011L12.862,19.536z M20.303,13.438L18.147,12 l2.156-1.438L20.303,13.438z"></path></svg>',
'deviantart' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M 18.19 5.636 18.19 2 18.188 2 14.553 2 14.19 2.366 12.474 5.636 11.935 6 5.81 6 5.81 10.994 9.177 10.994 9.477 11.357 5.81 18.363 5.81 22 5.811 22 9.447 22 9.81 21.634 11.526 18.364 12.065 18 18.19 18 18.19 13.006 14.823 13.006 14.523 12.641 18.19 5.636z"></path></svg>',
'dribbble' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M12,22C6.486,22,2,17.514,2,12S6.486,2,12,2c5.514,0,10,4.486,10,10S17.514,22,12,22z M20.434,13.369 c-0.292-0.092-2.644-0.794-5.32-0.365c1.117,3.07,1.572,5.57,1.659,6.09C18.689,17.798,20.053,15.745,20.434,13.369z M15.336,19.876c-0.127-0.749-0.623-3.361-1.822-6.477c-0.019,0.006-0.038,0.013-0.056,0.019c-4.818,1.679-6.547,5.02-6.701,5.334 c1.448,1.129,3.268,1.803,5.243,1.803C13.183,20.555,14.311,20.313,15.336,19.876z M5.654,17.724 c0.193-0.331,2.538-4.213,6.943-5.637c0.111-0.036,0.224-0.07,0.337-0.102c-0.214-0.485-0.448-0.971-0.692-1.45 c-4.266,1.277-8.405,1.223-8.778,1.216c-0.003,0.087-0.004,0.174-0.004,0.261C3.458,14.207,4.29,16.21,5.654,17.724z M3.639,10.264 c0.382,0.005,3.901,0.02,7.897-1.041c-1.415-2.516-2.942-4.631-3.167-4.94C5.979,5.41,4.193,7.613,3.639,10.264z M9.998,3.709 c0.236,0.316,1.787,2.429,3.187,5c3.037-1.138,4.323-2.867,4.477-3.085C16.154,4.286,14.17,3.471,12,3.471 C11.311,3.471,10.641,3.554,9.998,3.709z M18.612,6.612C18.432,6.855,17,8.69,13.842,9.979c0.199,0.407,0.389,0.821,0.567,1.237 c0.063,0.148,0.124,0.295,0.184,0.441c2.842-0.357,5.666,0.215,5.948,0.275C20.522,9.916,19.801,8.065,18.612,6.612z"></path></svg>',
'dropbox' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M12,6.134L6.069,9.797L2,6.54l5.883-3.843L12,6.134z M2,13.054l5.883,3.843L12,13.459L6.069,9.797L2,13.054z M12,13.459 l4.116,3.439L22,13.054l-4.069-3.257L12,13.459z M22,6.54l-5.884-3.843L12,6.134l5.931,3.663L22,6.54z M12.011,14.2l-4.129,3.426 l-1.767-1.153v1.291l5.896,3.539l5.897-3.539v-1.291l-1.769,1.153L12.011,14.2z"></path></svg>',
'etsy' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M9.16033,4.038c0-.27174.02717-.43478.48913-.43478h6.22283c1.087,0,1.68478.92391,2.11957,2.663l.35326,1.38587h1.05978C19.59511,3.712,19.75815,2,19.75815,2s-2.663.29891-4.23913.29891h-7.962L3.29076,2.163v1.1413L4.731,3.57609c1.00543.19022,1.25.40761,1.33152,1.33152,0,0,.08152,2.71739.08152,7.20109s-.08152,7.17391-.08152,7.17391c0,.81522-.32609,1.11413-1.33152,1.30435l-1.44022.27174V22l4.2663-.13587h7.11957c1.60326,0,5.32609.13587,5.32609.13587.08152-.97826.625-5.40761.70652-5.89674H19.7038L18.644,18.52174c-.84239,1.90217-2.06522,2.038-3.42391,2.038H11.1712c-1.3587,0-2.01087-.54348-2.01087-1.712V12.65217s3.0163,0,3.99457.08152c.76087.05435,1.22283.27174,1.46739,1.33152l.32609,1.413h1.16848l-.08152-3.55978.163-3.587H15.02989l-.38043,1.57609c-.24457,1.03261-.40761,1.22283-1.46739,1.33152-1.38587.13587-4.02174.1087-4.02174.1087Z"></path></svg>',
'facebook' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"></path></svg>',
'feed' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M2,8.667V12c5.515,0,10,4.485,10,10h3.333C15.333,14.637,9.363,8.667,2,8.667z M2,2v3.333 c9.19,0,16.667,7.477,16.667,16.667H22C22,10.955,13.045,2,2,2z M4.5,17C3.118,17,2,18.12,2,19.5S3.118,22,4.5,22S7,20.88,7,19.5 S5.882,17,4.5,17z"></path></svg>',
'flickr' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M6.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5S9.25,7,6.5,7z M17.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5 S20.25,7,17.5,7z"></path></svg>',
'foursquare' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M17.573,2c0,0-9.197,0-10.668,0S5,3.107,5,3.805s0,16.948,0,16.948c0,0.785,0.422,1.077,0.66,1.172 c0.238,0.097,0.892,0.177,1.285-0.275c0,0,5.035-5.843,5.122-5.93c0.132-0.132,0.132-0.132,0.262-0.132h3.26 c1.368,0,1.588-0.977,1.732-1.552c0.078-0.318,0.692-3.428,1.225-6.122l0.675-3.368C19.56,2.893,19.14,2,17.573,2z M16.495,7.22 c-0.053,0.252-0.372,0.518-0.665,0.518c-0.293,0-4.157,0-4.157,0c-0.467,0-0.802,0.318-0.802,0.787v0.508 c0,0.467,0.337,0.798,0.805,0.798c0,0,3.197,0,3.528,0s0.655,0.362,0.583,0.715c-0.072,0.353-0.407,2.102-0.448,2.295 c-0.04,0.193-0.262,0.523-0.655,0.523c-0.33,0-2.88,0-2.88,0c-0.523,0-0.683,0.068-1.033,0.503 c-0.35,0.437-3.505,4.223-3.505,4.223c-0.032,0.035-0.063,0.027-0.063-0.015V4.852c0-0.298,0.26-0.648,0.648-0.648 c0,0,8.228,0,8.562,0c0.315,0,0.61,0.297,0.528,0.683L16.495,7.22z"></path></svg>',
'goodreads' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M17.3,17.5c-0.2,0.8-0.5,1.4-1,1.9c-0.4,0.5-1,0.9-1.7,1.2C13.9,20.9,13.1,21,12,21c-0.6,0-1.3-0.1-1.9-0.2 c-0.6-0.1-1.1-0.4-1.6-0.7c-0.5-0.3-0.9-0.7-1.2-1.2c-0.3-0.5-0.5-1.1-0.5-1.7h1.5c0.1,0.5,0.2,0.9,0.5,1.2 c0.2,0.3,0.5,0.6,0.9,0.8c0.3,0.2,0.7,0.3,1.1,0.4c0.4,0.1,0.8,0.1,1.2,0.1c1.4,0,2.5-0.4,3.1-1.2c0.6-0.8,1-2,1-3.5v-1.7h0 c-0.4,0.8-0.9,1.4-1.6,1.9c-0.7,0.5-1.5,0.7-2.4,0.7c-1,0-1.9-0.2-2.6-0.5C8.7,15,8.1,14.5,7.7,14c-0.5-0.6-0.8-1.3-1-2.1 c-0.2-0.8-0.3-1.6-0.3-2.5c0-0.9,0.1-1.7,0.4-2.5c0.3-0.8,0.6-1.5,1.1-2c0.5-0.6,1.1-1,1.8-1.4C10.3,3.2,11.1,3,12,3 c0.5,0,0.9,0.1,1.3,0.2c0.4,0.1,0.8,0.3,1.1,0.5c0.3,0.2,0.6,0.5,0.9,0.8c0.3,0.3,0.5,0.6,0.6,1h0V3.4h1.5V15 C17.6,15.9,17.5,16.7,17.3,17.5z M13.8,14.1c0.5-0.3,0.9-0.7,1.3-1.1c0.3-0.5,0.6-1,0.8-1.6c0.2-0.6,0.3-1.2,0.3-1.9 c0-0.6-0.1-1.2-0.2-1.9c-0.1-0.6-0.4-1.2-0.7-1.7c-0.3-0.5-0.7-0.9-1.3-1.2c-0.5-0.3-1.1-0.5-1.9-0.5s-1.4,0.2-1.9,0.5 c-0.5,0.3-1,0.7-1.3,1.2C8.5,6.4,8.3,7,8.1,7.6C8,8.2,7.9,8.9,7.9,9.5c0,0.6,0.1,1.3,0.2,1.9C8.3,12,8.6,12.5,8.9,13 c0.3,0.5,0.8,0.8,1.3,1.1c0.5,0.3,1.1,0.4,1.9,0.4C12.7,14.5,13.3,14.4,13.8,14.1z"></path></svg>',
'google' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M12.02,10.18v3.72v0.01h5.51c-0.26,1.57-1.67,4.22-5.5,4.22c-3.31,0-6.01-2.75-6.01-6.12s2.7-6.12,6.01-6.12 c1.87,0,3.13,0.8,3.85,1.48l2.84-2.76C16.99,2.99,14.73,2,12.03,2c-5.52,0-10,4.48-10,10s4.48,10,10,10c5.77,0,9.6-4.06,9.6-9.77 c0-0.83-0.11-1.42-0.25-2.05H12.02z"></path></svg>',
'github' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"></path></svg>',
'instagram' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M12,4.622c2.403,0,2.688,0.009,3.637,0.052c0.877,0.04,1.354,0.187,1.671,0.31c0.42,0.163,0.72,0.358,1.035,0.673 c0.315,0.315,0.51,0.615,0.673,1.035c0.123,0.317,0.27,0.794,0.31,1.671c0.043,0.949,0.052,1.234,0.052,3.637 s-0.009,2.688-0.052,3.637c-0.04,0.877-0.187,1.354-0.31,1.671c-0.163,0.42-0.358,0.72-0.673,1.035 c-0.315,0.315-0.615,0.51-1.035,0.673c-0.317,0.123-0.794,0.27-1.671,0.31c-0.949,0.043-1.233,0.052-3.637,0.052 s-2.688-0.009-3.637-0.052c-0.877-0.04-1.354-0.187-1.671-0.31c-0.42-0.163-0.72-0.358-1.035-0.673 c-0.315-0.315-0.51-0.615-0.673-1.035c-0.123-0.317-0.27-0.794-0.31-1.671C4.631,14.688,4.622,14.403,4.622,12 s0.009-2.688,0.052-3.637c0.04-0.877,0.187-1.354,0.31-1.671c0.163-0.42,0.358-0.72,0.673-1.035 c0.315-0.315,0.615-0.51,1.035-0.673c0.317-0.123,0.794-0.27,1.671-0.31C9.312,4.631,9.597,4.622,12,4.622 M12,3 C9.556,3,9.249,3.01,8.289,3.054C7.331,3.098,6.677,3.25,6.105,3.472C5.513,3.702,5.011,4.01,4.511,4.511 c-0.5,0.5-0.808,1.002-1.038,1.594C3.25,6.677,3.098,7.331,3.054,8.289C3.01,9.249,3,9.556,3,12c0,2.444,0.01,2.751,0.054,3.711 c0.044,0.958,0.196,1.612,0.418,2.185c0.23,0.592,0.538,1.094,1.038,1.594c0.5,0.5,1.002,0.808,1.594,1.038 c0.572,0.222,1.227,0.375,2.185,0.418C9.249,20.99,9.556,21,12,21s2.751-0.01,3.711-0.054c0.958-0.044,1.612-0.196,2.185-0.418 c0.592-0.23,1.094-0.538,1.594-1.038c0.5-0.5,0.808-1.002,1.038-1.594c0.222-0.572,0.375-1.227,0.418-2.185 C20.99,14.751,21,14.444,21,12s-0.01-2.751-0.054-3.711c-0.044-0.958-0.196-1.612-0.418-2.185c-0.23-0.592-0.538-1.094-1.038-1.594 c-0.5-0.5-1.002-0.808-1.594-1.038c-0.572-0.222-1.227-0.375-2.185-0.418C14.751,3.01,14.444,3,12,3L12,3z M12,7.378 c-2.552,0-4.622,2.069-4.622,4.622S9.448,16.622,12,16.622s4.622-2.069,4.622-4.622S14.552,7.378,12,7.378z M12,15 c-1.657,0-3-1.343-3-3s1.343-3,3-3s3,1.343,3,3S13.657,15,12,15z M16.804,6.116c-0.596,0-1.08,0.484-1.08,1.08 s0.484,1.08,1.08,1.08c0.596,0,1.08-0.484,1.08-1.08S17.401,6.116,16.804,6.116z"></path></svg>',
'lastfm' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M10.5002,0 C4.7006,0 0,4.70109753 0,10.4998496 C0,16.2989526 4.7006,21 10.5002,21 C16.299,21 21,16.2989526 21,10.4998496 C21,4.70109753 16.299,0 10.5002,0 Z M14.69735,14.7204413 C13.3164,14.7151781 12.4346,14.0870017 11.83445,12.6859357 L11.6816001,12.3451305 L10.35405,9.31011397 C9.92709997,8.26875064 8.85260001,7.57120012 7.68010001,7.57120012 C6.06945001,7.57120012 4.75925001,8.88509738 4.75925001,10.5009524 C4.75925001,12.1164565 6.06945001,13.4303036 7.68010001,13.4303036 C8.77200001,13.4303036 9.76514999,12.827541 10.2719501,11.8567047 C10.2893,11.8235214 10.3239,11.8019673 10.36305,11.8038219 C10.4007,11.8053759 10.43535,11.8287847 10.4504,11.8631709 L10.98655,13.1045863 C11.0016,13.1389726 10.9956,13.17782 10.97225,13.2068931 C10.1605001,14.1995341 8.96020001,14.7683115 7.68010001,14.7683115 C5.33305,14.7683115 3.42340001,12.8535563 3.42340001,10.5009524 C3.42340001,8.14679459 5.33300001,6.23203946 7.68010001,6.23203946 C9.45720002,6.23203946 10.8909,7.19074535 11.6138,8.86359341 C11.6205501,8.88018505 12.3412,10.5707777 12.97445,12.0190621 C13.34865,12.8739575 13.64615,13.3959676 14.6288,13.4291508 C15.5663001,13.4612814 16.25375,12.9121534 16.25375,12.1484869 C16.25375,11.4691321 15.8320501,11.3003585 14.8803,10.98216 C13.2365,10.4397989 12.34495,9.88605929 12.34495,8.51817658 C12.34495,7.1809207 13.26665,6.31615054 14.692,6.31615054 C15.62875,6.31615054 16.3155,6.7286858 16.79215,7.5768142 C16.80495,7.60062396 16.8079001,7.62814302 16.8004001,7.65420843 C16.7929,7.68027384 16.7748,7.70212868 16.7507001,7.713808 L15.86145,8.16900031 C15.8178001,8.19200805 15.7643,8.17807308 15.73565,8.13847371 C15.43295,7.71345711 15.0956,7.52513451 14.6423,7.52513451 C14.05125,7.52513451 13.6220001,7.92899802 13.6220001,8.48649708 C13.6220001,9.17382194 14.1529001,9.34144259 15.0339,9.61923972 C15.14915,9.65578139 15.26955,9.69397731 15.39385,9.73432853 C16.7763,10.1865133 17.57675,10.7311301 17.57675,12.1836251 C17.57685,13.629654 16.3389,14.7204413 14.69735,14.7204413 Z"></path></svg>',
'linkedin' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"></path></svg>',
'mail' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M20,4H4C2.895,4,2,4.895,2,6v12c0,1.105,0.895,2,2,2h16c1.105,0,2-0.895,2-2V6C22,4.895,21.105,4,20,4z M20,8.236l-8,4.882 L4,8.236V6h16V8.236z"></path></svg>',
'mastodon' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M23.193 7.879c0-5.206-3.411-6.732-3.411-6.732C18.062.357 15.108.025 12.041 0h-.076c-3.068.025-6.02.357-7.74 1.147 0 0-3.411 1.526-3.411 6.732 0 1.192-.023 2.618.015 4.129.124 5.092.934 10.109 5.641 11.355 2.17.574 4.034.695 5.535.612 2.722-.15 4.25-.972 4.25-.972l-.09-1.975s-1.945.613-4.129.539c-2.165-.074-4.449-.233-4.799-2.891a5.499 5.499 0 0 1-.048-.745s2.125.52 4.817.643c1.646.075 3.19-.097 4.758-.283 3.007-.359 5.625-2.212 5.954-3.905.517-2.665.475-6.507.475-6.507zm-4.024 6.709h-2.497V8.469c0-1.29-.543-1.944-1.628-1.944-1.2 0-1.802.776-1.802 2.312v3.349h-2.483v-3.35c0-1.536-.602-2.312-1.802-2.312-1.085 0-1.628.655-1.628 1.944v6.119H4.832V8.284c0-1.289.328-2.313.987-3.07.68-.758 1.569-1.146 2.674-1.146 1.278 0 2.246.491 2.886 1.474L12 6.585l.622-1.043c.64-.983 1.608-1.474 2.886-1.474 1.104 0 1.994.388 2.674 1.146.658.757.986 1.781.986 3.07v6.304z"/></svg>',
'medium' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M20.962,7.257l-5.457,8.867l-3.923-6.375l3.126-5.08c0.112-0.182,0.319-0.286,0.527-0.286c0.05,0,0.1,0.008,0.149,0.02 c0.039,0.01,0.078,0.023,0.114,0.041l5.43,2.715l0.006,0.003c0.004,0.002,0.007,0.006,0.011,0.008 C20.971,7.191,20.98,7.227,20.962,7.257z M9.86,8.592v5.783l5.14,2.57L9.86,8.592z M15.772,17.331l4.231,2.115 C20.554,19.721,21,19.529,21,19.016V8.835L15.772,17.331z M8.968,7.178L3.665,4.527C3.569,4.479,3.478,4.456,3.395,4.456 C3.163,4.456,3,4.636,3,4.938v11.45c0,0.306,0.224,0.669,0.498,0.806l4.671,2.335c0.12,0.06,0.234,0.088,0.337,0.088 c0.29,0,0.494-0.225,0.494-0.602V7.231C9,7.208,8.988,7.188,8.968,7.178z"></path></svg>',
'meetup' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M19.24775,14.722a3.57032,3.57032,0,0,1-2.94457,3.52073,3.61886,3.61886,0,0,1-.64652.05634c-.07314-.0008-.10187.02846-.12507.09547A2.38881,2.38881,0,0,1,13.49453,20.094a2.33092,2.33092,0,0,1-1.827-.50716.13635.13635,0,0,0-.19878-.00408,3.191,3.191,0,0,1-2.104.60248,3.26309,3.26309,0,0,1-3.00324-2.71993,2.19076,2.19076,0,0,1-.03512-.30865c-.00156-.08579-.03413-.1189-.11608-.13493a2.86421,2.86421,0,0,1-1.23189-.56111,2.945,2.945,0,0,1-1.166-2.05749,2.97484,2.97484,0,0,1,.87524-2.50774.112.112,0,0,0,.02091-.16107,2.7213,2.7213,0,0,1-.36648-1.48A2.81256,2.81256,0,0,1,6.57673,7.58838a.35764.35764,0,0,0,.28869-.22819,4.2208,4.2208,0,0,1,6.02892-1.90111.25161.25161,0,0,0,.22023.0243,3.65608,3.65608,0,0,1,3.76031.90678A3.57244,3.57244,0,0,1,17.95918,8.626a2.97339,2.97339,0,0,1,.01829.57356.10637.10637,0,0,0,.0853.12792,1.97669,1.97669,0,0,1,1.27939,1.33733,2.00266,2.00266,0,0,1-.57112,2.12652c-.05284.05166-.04168.08328-.01173.13489A3.51189,3.51189,0,0,1,19.24775,14.722Zm-6.35959-.27836a1.6984,1.6984,0,0,0,1.14556,1.61113,3.82039,3.82039,0,0,0,1.036.17935,1.46888,1.46888,0,0,0,.73509-.12255.44082.44082,0,0,0,.26057-.44274.45312.45312,0,0,0-.29211-.43375.97191.97191,0,0,0-.20678-.063c-.21326-.03806-.42754-.0701-.63973-.11215a.54787.54787,0,0,1-.50172-.60926,2.75864,2.75864,0,0,1,.1773-.901c.1763-.535.414-1.045.64183-1.55913A12.686,12.686,0,0,0,15.85,10.47863a1.58461,1.58461,0,0,0,.04861-.87208,1.04531,1.04531,0,0,0-.85432-.83981,1.60658,1.60658,0,0,0-1.23654.16594.27593.27593,0,0,1-.36286-.03413c-.085-.0747-.16594-.15379-.24918-.23055a.98682.98682,0,0,0-1.33577-.04933,6.1468,6.1468,0,0,1-.4989.41615.47762.47762,0,0,1-.51535.03566c-.17448-.09307-.35512-.175-.53531-.25665a1.74949,1.74949,0,0,0-.56476-.2016,1.69943,1.69943,0,0,0-1.61654.91787,8.05815,8.05815,0,0,0-.32952.80126c-.45471,1.2557-.82507,2.53825-1.20838,3.81639a1.24151,1.24151,0,0,0,.51532,1.44389,1.42659,1.42659,0,0,0,1.22008.17166,1.09728,1.09728,0,0,0,.66994-.69764c.44145-1.04111.839-2.09989,1.25981-3.14926.11581-.28876.22792-.57874.35078-.86438a.44548.44548,0,0,1,.69189-.19539.50521.50521,0,0,1,.15044.43836,1.75625,1.75625,0,0,1-.14731.50453c-.27379.69219-.55265,1.38236-.82766,2.074a2.0836,2.0836,0,0,0-.14038.42876.50719.50719,0,0,0,.27082.57722.87236.87236,0,0,0,.66145.02739.99137.99137,0,0,0,.53406-.532q.61571-1.20914,1.228-2.42031.28423-.55863.57585-1.1133a.87189.87189,0,0,1,.29055-.35253.34987.34987,0,0,1,.37634-.01265.30291.30291,0,0,1,.12434.31459.56716.56716,0,0,1-.04655.1915c-.05318.12739-.10286.25669-.16183.38156-.34118.71775-.68754,1.43273-1.02568,2.152A2.00213,2.00213,0,0,0,12.88816,14.44366Zm4.78568,5.28972a.88573.88573,0,0,0-1.77139.00465.8857.8857,0,0,0,1.77139-.00465Zm-14.83838-7.296a.84329.84329,0,1,0,.00827-1.68655.8433.8433,0,0,0-.00827,1.68655Zm10.366-9.43673a.83506.83506,0,1,0-.0091,1.67.83505.83505,0,0,0,.0091-1.67Zm6.85014,5.22a.71651.71651,0,0,0-1.433.0093.71656.71656,0,0,0,1.433-.0093ZM5.37528,6.17908A.63823.63823,0,1,0,6.015,5.54483.62292.62292,0,0,0,5.37528,6.17908Zm6.68214,14.80843a.54949.54949,0,1,0-.55052.541A.54556.54556,0,0,0,12.05742,20.98752Zm8.53235-8.49689a.54777.54777,0,0,0-.54027.54023.53327.53327,0,0,0,.532.52293.51548.51548,0,0,0,.53272-.5237A.53187.53187,0,0,0,20.58977,12.49063ZM7.82846,2.4715a.44927.44927,0,1,0,.44484.44766A.43821.43821,0,0,0,7.82846,2.4715Zm13.775,7.60492a.41186.41186,0,0,0-.40065.39623.40178.40178,0,0,0,.40168.40168A.38994.38994,0,0,0,22,10.48172.39946.39946,0,0,0,21.60349,10.07642ZM5.79193,17.96207a.40469.40469,0,0,0-.397-.39646.399.399,0,0,0-.396.405.39234.39234,0,0,0,.39939.389A.39857.39857,0,0,0,5.79193,17.96207Z"></path></svg>',
'pinterest' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2"></path></svg>',
'pocket' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M21.927,4.194C21.667,3.48,20.982,3,20.222,3h-0.01h-1.721H3.839C3.092,3,2.411,3.47,2.145,4.17 C2.066,4.378,2.026,4.594,2.026,4.814v6.035l0.069,1.2c0.29,2.73,1.707,5.115,3.899,6.778c0.039,0.03,0.079,0.059,0.119,0.089 l0.025,0.018c1.175,0.859,2.491,1.441,3.91,1.727c0.655,0.132,1.325,0.2,1.991,0.2c0.615,0,1.232-0.057,1.839-0.17 c0.073-0.014,0.145-0.028,0.219-0.044c0.02-0.004,0.042-0.012,0.064-0.023c1.359-0.297,2.621-0.864,3.753-1.691l0.025-0.018 c0.04-0.029,0.08-0.058,0.119-0.089c2.192-1.664,3.609-4.049,3.898-6.778l0.069-1.2V4.814C22.026,4.605,22,4.398,21.927,4.194z M17.692,10.481l-4.704,4.512c-0.266,0.254-0.608,0.382-0.949,0.382c-0.342,0-0.684-0.128-0.949-0.382l-4.705-4.512 C5.838,9.957,5.82,9.089,6.344,8.542c0.524-0.547,1.392-0.565,1.939-0.04l3.756,3.601l3.755-3.601 c0.547-0.524,1.415-0.506,1.939,0.04C18.256,9.089,18.238,9.956,17.692,10.481z"></path></svg>',
'reddit' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M22,11.816c0-1.256-1.021-2.277-2.277-2.277c-0.593,0-1.122,0.24-1.526,0.614c-1.481-0.965-3.455-1.594-5.647-1.69 l1.171-3.702l3.18,0.748c0.008,1.028,0.846,1.862,1.876,1.862c1.035,0,1.877-0.842,1.877-1.878c0-1.035-0.842-1.877-1.877-1.877 c-0.769,0-1.431,0.466-1.72,1.13l-3.508-0.826c-0.203-0.047-0.399,0.067-0.46,0.261l-1.35,4.268 c-2.316,0.038-4.411,0.67-5.97,1.671C5.368,9.765,4.853,9.539,4.277,9.539C3.021,9.539,2,10.56,2,11.816 c0,0.814,0.433,1.523,1.078,1.925c-0.037,0.221-0.061,0.444-0.061,0.672c0,3.292,4.011,5.97,8.941,5.97s8.941-2.678,8.941-5.97 c0-0.214-0.02-0.424-0.053-0.632C21.533,13.39,22,12.661,22,11.816z M18.776,4.394c0.606,0,1.1,0.493,1.1,1.1s-0.493,1.1-1.1,1.1 s-1.1-0.494-1.1-1.1S18.169,4.394,18.776,4.394z M2.777,11.816c0-0.827,0.672-1.5,1.499-1.5c0.313,0,0.598,0.103,0.838,0.269 c-0.851,0.676-1.477,1.479-1.812,2.36C2.983,12.672,2.777,12.27,2.777,11.816z M11.959,19.606c-4.501,0-8.164-2.329-8.164-5.193 S7.457,9.22,11.959,9.22s8.164,2.329,8.164,5.193S16.46,19.606,11.959,19.606z M20.636,13.001c-0.326-0.89-0.948-1.701-1.797-2.384 c0.248-0.186,0.55-0.301,0.883-0.301c0.827,0,1.5,0.673,1.5,1.5C21.223,12.299,20.992,12.727,20.636,13.001z M8.996,14.704 c-0.76,0-1.397-0.616-1.397-1.376c0-0.76,0.637-1.397,1.397-1.397c0.76,0,1.376,0.637,1.376,1.397 C10.372,14.088,9.756,14.704,8.996,14.704z M16.401,13.328c0,0.76-0.616,1.376-1.376,1.376c-0.76,0-1.399-0.616-1.399-1.376 c0-0.76,0.639-1.397,1.399-1.397C15.785,11.931,16.401,12.568,16.401,13.328z M15.229,16.708c0.152,0.152,0.152,0.398,0,0.55 c-0.674,0.674-1.727,1.002-3.219,1.002c-0.004,0-0.007-0.002-0.011-0.002c-0.004,0-0.007,0.002-0.011,0.002 c-1.492,0-2.544-0.328-3.218-1.002c-0.152-0.152-0.152-0.398,0-0.55c0.152-0.152,0.399-0.151,0.55,0 c0.521,0.521,1.394,0.775,2.669,0.775c0.004,0,0.007,0.002,0.011,0.002c0.004,0,0.007-0.002,0.011-0.002 c1.275,0,2.148-0.253,2.669-0.775C14.831,16.556,15.078,16.556,15.229,16.708z"></path></svg>',
'skype' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M10.113,2.699c0.033-0.006,0.067-0.013,0.1-0.02c0.033,0.017,0.066,0.033,0.098,0.051L10.113,2.699z M2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223z M21.275,13.771 c0.007-0.035,0.011-0.071,0.018-0.106c-0.018-0.031-0.033-0.064-0.052-0.095L21.275,13.771z M13.563,21.199 c0.032,0.019,0.065,0.035,0.096,0.053c0.036-0.006,0.071-0.011,0.105-0.017L13.563,21.199z M22,16.386 c0,1.494-0.581,2.898-1.637,3.953c-1.056,1.057-2.459,1.637-3.953,1.637c-0.967,0-1.914-0.251-2.75-0.725 c0.036-0.006,0.071-0.011,0.105-0.017l-0.202-0.035c0.032,0.019,0.065,0.035,0.096,0.053c-0.543,0.096-1.099,0.147-1.654,0.147 c-1.275,0-2.512-0.25-3.676-0.743c-1.125-0.474-2.135-1.156-3.002-2.023c-0.867-0.867-1.548-1.877-2.023-3.002 c-0.493-1.164-0.743-2.401-0.743-3.676c0-0.546,0.049-1.093,0.142-1.628c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103C2.244,9.5,2,8.566,2,7.615c0-1.493,0.582-2.898,1.637-3.953 c1.056-1.056,2.46-1.638,3.953-1.638c0.915,0,1.818,0.228,2.622,0.655c-0.033,0.007-0.067,0.013-0.1,0.02l0.199,0.031 c-0.032-0.018-0.066-0.034-0.098-0.051c0.002,0,0.003-0.001,0.004-0.001c0.586-0.112,1.187-0.169,1.788-0.169 c1.275,0,2.512,0.249,3.676,0.742c1.124,0.476,2.135,1.156,3.002,2.024c0.868,0.867,1.548,1.877,2.024,3.002 c0.493,1.164,0.743,2.401,0.743,3.676c0,0.575-0.054,1.15-0.157,1.712c-0.018-0.031-0.033-0.064-0.052-0.095l0.034,0.201 c0.007-0.035,0.011-0.071,0.018-0.106C21.754,14.494,22,15.432,22,16.386z M16.817,14.138c0-1.331-0.613-2.743-3.033-3.282 l-2.209-0.49c-0.84-0.192-1.807-0.444-1.807-1.237c0-0.794,0.679-1.348,1.903-1.348c2.468,0,2.243,1.696,3.468,1.696 c0.645,0,1.209-0.379,1.209-1.031c0-1.521-2.435-2.663-4.5-2.663c-2.242,0-4.63,0.952-4.63,3.488c0,1.221,0.436,2.521,2.839,3.123 l2.984,0.745c0.903,0.223,1.129,0.731,1.129,1.189c0,0.762-0.758,1.507-2.129,1.507c-2.679,0-2.307-2.062-3.743-2.062 c-0.645,0-1.113,0.444-1.113,1.078c0,1.236,1.501,2.886,4.856,2.886C15.236,17.737,16.817,16.199,16.817,14.138z"></path></svg>',
'snapchat' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M12.065,2a5.526,5.526,0,0,1,3.132.892A5.854,5.854,0,0,1,17.326,5.4a5.821,5.821,0,0,1,.351,2.33q0,.612-.117,2.487a.809.809,0,0,0,.365.091,1.93,1.93,0,0,0,.664-.176,1.93,1.93,0,0,1,.664-.176,1.3,1.3,0,0,1,.729.234.7.7,0,0,1,.351.6.839.839,0,0,1-.41.7,2.732,2.732,0,0,1-.9.41,3.192,3.192,0,0,0-.9.378.728.728,0,0,0-.41.618,1.575,1.575,0,0,0,.156.56,6.9,6.9,0,0,0,1.334,1.953,5.6,5.6,0,0,0,1.881,1.315,5.875,5.875,0,0,0,1.042.3.42.42,0,0,1,.365.456q0,.911-2.852,1.341a1.379,1.379,0,0,0-.143.507,1.8,1.8,0,0,1-.182.605.451.451,0,0,1-.429.241,5.878,5.878,0,0,1-.807-.085,5.917,5.917,0,0,0-.833-.085,4.217,4.217,0,0,0-.807.065,2.42,2.42,0,0,0-.82.293,6.682,6.682,0,0,0-.755.5q-.351.267-.755.527a3.886,3.886,0,0,1-.989.436A4.471,4.471,0,0,1,11.831,22a4.307,4.307,0,0,1-1.256-.176,3.784,3.784,0,0,1-.976-.436q-.4-.26-.749-.527a6.682,6.682,0,0,0-.755-.5,2.422,2.422,0,0,0-.807-.293,4.432,4.432,0,0,0-.82-.065,5.089,5.089,0,0,0-.853.1,5,5,0,0,1-.762.1.474.474,0,0,1-.456-.241,1.819,1.819,0,0,1-.182-.618,1.411,1.411,0,0,0-.143-.521q-2.852-.429-2.852-1.341a.42.42,0,0,1,.365-.456,5.793,5.793,0,0,0,1.042-.3,5.524,5.524,0,0,0,1.881-1.315,6.789,6.789,0,0,0,1.334-1.953A1.575,1.575,0,0,0,6,12.9a.728.728,0,0,0-.41-.618,3.323,3.323,0,0,0-.9-.384,2.912,2.912,0,0,1-.9-.41.814.814,0,0,1-.41-.684.71.71,0,0,1,.338-.593,1.208,1.208,0,0,1,.716-.241,1.976,1.976,0,0,1,.625.169,2.008,2.008,0,0,0,.69.169.919.919,0,0,0,.416-.091q-.117-1.849-.117-2.474A5.861,5.861,0,0,1,6.385,5.4,5.516,5.516,0,0,1,8.625,2.819,7.075,7.075,0,0,1,12.062,2Z"></path></svg>',
'soundcloud' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M8.9,16.1L9,14L8.9,9.5c0-0.1,0-0.1-0.1-0.1c0,0-0.1-0.1-0.1-0.1c-0.1,0-0.1,0-0.1,0.1c0,0-0.1,0.1-0.1,0.1L8.3,14l0.1,2.1 c0,0.1,0,0.1,0.1,0.1c0,0,0.1,0.1,0.1,0.1C8.8,16.3,8.9,16.3,8.9,16.1z M11.4,15.9l0.1-1.8L11.4,9c0-0.1,0-0.2-0.1-0.2 c0,0-0.1,0-0.1,0s-0.1,0-0.1,0c-0.1,0-0.1,0.1-0.1,0.2l0,0.1l-0.1,5c0,0,0,0.7,0.1,2v0c0,0.1,0,0.1,0.1,0.1c0.1,0.1,0.1,0.1,0.2,0.1 c0.1,0,0.1,0,0.2-0.1c0.1,0,0.1-0.1,0.1-0.2L11.4,15.9z M2.4,12.9L2.5,14l-0.2,1.1c0,0.1,0,0.1-0.1,0.1c0,0-0.1,0-0.1-0.1L2.1,14 l0.1-1.1C2.2,12.9,2.3,12.9,2.4,12.9C2.3,12.9,2.4,12.9,2.4,12.9z M3.1,12.2L3.3,14l-0.2,1.8c0,0.1,0,0.1-0.1,0.1 c-0.1,0-0.1,0-0.1-0.1L2.8,14L3,12.2C3,12.2,3,12.2,3.1,12.2C3.1,12.2,3.1,12.2,3.1,12.2z M3.9,11.9L4.1,14l-0.2,2.1 c0,0.1,0,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L3.5,14l0.2-2.1c0-0.1,0-0.1,0.1-0.1C3.9,11.8,3.9,11.8,3.9,11.9z M4.7,11.9L4.9,14 l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L4.3,14l0.2-2.2c0-0.1,0-0.1,0.1-0.1C4.7,11.7,4.7,11.8,4.7,11.9z M5.6,12 l0.2,2l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c0,0-0.1,0-0.1,0c0,0,0-0.1,0-0.1L5.1,14l0.2-2c0,0,0-0.1,0-0.1s0.1,0,0.1,0 C5.5,11.9,5.5,11.9,5.6,12L5.6,12z M6.4,10.7L6.6,14l-0.2,2.1c0,0,0,0.1,0,0.1c0,0-0.1,0-0.1,0c-0.1,0-0.1-0.1-0.2-0.2L5.9,14 l0.2-3.3c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0C6.4,10.7,6.4,10.7,6.4,10.7z M7.2,10l0.2,4.1l-0.2,2.1c0,0,0,0.1,0,0.1 c0,0-0.1,0-0.1,0c-0.1,0-0.2-0.1-0.2-0.2l-0.1-2.1L6.8,10c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0S7.2,9.9,7.2,10z M8,9.6L8.2,14 L8,16.1c0,0.1-0.1,0.2-0.2,0.2c-0.1,0-0.2-0.1-0.2-0.2L7.5,14l0.1-4.4c0-0.1,0-0.1,0.1-0.1c0,0,0.1-0.1,0.1-0.1c0.1,0,0.1,0,0.1,0.1 C8,9.6,8,9.6,8,9.6z M11.4,16.1L11.4,16.1L11.4,16.1z M9.7,9.6L9.8,14l-0.1,2.1c0,0.1,0,0.1-0.1,0.2s-0.1,0.1-0.2,0.1 c-0.1,0-0.1,0-0.1-0.1s-0.1-0.1-0.1-0.2L9.2,14l0.1-4.4c0-0.1,0-0.1,0.1-0.2s0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S9.7,9.5,9.7,9.6 L9.7,9.6z M10.6,9.8l0.1,4.3l-0.1,2c0,0.1,0,0.1-0.1,0.2c0,0-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c0,0-0.1-0.1-0.1-0.2L10,14 l0.1-4.3c0-0.1,0-0.1,0.1-0.2c0,0,0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S10.6,9.7,10.6,9.8z M12.4,14l-0.1,2c0,0.1,0,0.1-0.1,0.2 c-0.1,0.1-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2l-0.1-1l-0.1-1l0.1-5.5v0c0-0.1,0-0.2,0.1-0.2 c0.1,0,0.1-0.1,0.2-0.1c0,0,0.1,0,0.1,0c0.1,0,0.1,0.1,0.1,0.2L12.4,14z M22.1,13.9c0,0.7-0.2,1.3-0.7,1.7c-0.5,0.5-1.1,0.7-1.7,0.7 h-6.8c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2V8.2c0-0.1,0.1-0.2,0.2-0.3c0.5-0.2,1-0.3,1.6-0.3c1.1,0,2.1,0.4,2.9,1.1 c0.8,0.8,1.3,1.7,1.4,2.8c0.3-0.1,0.6-0.2,1-0.2c0.7,0,1.3,0.2,1.7,0.7C21.8,12.6,22.1,13.2,22.1,13.9L22.1,13.9z"></path></svg>',
'spotify' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M12,2C6.477,2,2,6.477,2,12c0,5.523,4.477,10,10,10c5.523,0,10-4.477,10-10C22,6.477,17.523,2,12,2 M16.586,16.424 c-0.18,0.295-0.563,0.387-0.857,0.207c-2.348-1.435-5.304-1.76-8.785-0.964c-0.335,0.077-0.67-0.133-0.746-0.469 c-0.077-0.335,0.132-0.67,0.469-0.746c3.809-0.871,7.077-0.496,9.713,1.115C16.673,15.746,16.766,16.13,16.586,16.424 M17.81,13.7 c-0.226,0.367-0.706,0.482-1.072,0.257c-2.687-1.652-6.785-2.131-9.965-1.166C6.36,12.917,5.925,12.684,5.8,12.273 C5.675,11.86,5.908,11.425,6.32,11.3c3.632-1.102,8.147-0.568,11.234,1.328C17.92,12.854,18.035,13.335,17.81,13.7 M17.915,10.865 c-3.223-1.914-8.54-2.09-11.618-1.156C5.804,9.859,5.281,9.58,5.131,9.086C4.982,8.591,5.26,8.069,5.755,7.919 c3.532-1.072,9.404-0.865,13.115,1.338c0.445,0.264,0.59,0.838,0.327,1.282C18.933,10.983,18.359,11.129,17.915,10.865"></path></svg>',
'tumblr' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M16.749,17.396c-0.357,0.17-1.041,0.319-1.551,0.332c-1.539,0.041-1.837-1.081-1.85-1.896V9.847h3.861V6.937h-3.847V2.039 c0,0-2.77,0-2.817,0c-0.046,0-0.127,0.041-0.138,0.144c-0.165,1.499-0.867,4.13-3.783,5.181v2.484h1.945v6.282 c0,2.151,1.587,5.206,5.775,5.135c1.413-0.024,2.982-0.616,3.329-1.126L16.749,17.396z"></path></svg>',
'twitch' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M16.499,8.089h-1.636v4.91h1.636V8.089z M12,8.089h-1.637v4.91H12V8.089z M4.228,3.178L3,6.451v13.092h4.499V22h2.456 l2.454-2.456h3.681L21,14.636V3.178H4.228z M19.364,13.816l-2.864,2.865H12l-2.453,2.453V16.68H5.863V4.814h13.501V13.816z"></path></svg>',
'twitter' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M22.23,5.924c-0.736,0.326-1.527,0.547-2.357,0.646c0.847-0.508,1.498-1.312,1.804-2.27 c-0.793,0.47-1.671,0.812-2.606,0.996C18.324,4.498,17.257,4,16.077,4c-2.266,0-4.103,1.837-4.103,4.103 c0,0.322,0.036,0.635,0.106,0.935C8.67,8.867,5.647,7.234,3.623,4.751C3.27,5.357,3.067,6.062,3.067,6.814 c0,1.424,0.724,2.679,1.825,3.415c-0.673-0.021-1.305-0.206-1.859-0.513c0,0.017,0,0.034,0,0.052c0,1.988,1.414,3.647,3.292,4.023 c-0.344,0.094-0.707,0.144-1.081,0.144c-0.264,0-0.521-0.026-0.772-0.074c0.522,1.63,2.038,2.816,3.833,2.85 c-1.404,1.1-3.174,1.756-5.096,1.756c-0.331,0-0.658-0.019-0.979-0.057c1.816,1.164,3.973,1.843,6.29,1.843 c7.547,0,11.675-6.252,11.675-11.675c0-0.178-0.004-0.355-0.012-0.531C20.985,7.47,21.68,6.747,22.23,5.924z"></path></svg>',
'vimeo' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M22.396,7.164c-0.093,2.026-1.507,4.799-4.245,8.32C15.322,19.161,12.928,21,10.97,21c-1.214,0-2.24-1.119-3.079-3.359 c-0.56-2.053-1.119-4.106-1.68-6.159C5.588,9.243,4.921,8.122,4.206,8.122c-0.156,0-0.701,0.328-1.634,0.98L1.594,7.841 c1.027-0.902,2.04-1.805,3.037-2.708C6.001,3.95,7.03,3.327,7.715,3.264c1.619-0.156,2.616,0.951,2.99,3.321 c0.404,2.557,0.685,4.147,0.841,4.769c0.467,2.121,0.981,3.181,1.542,3.181c0.435,0,1.09-0.688,1.963-2.065 c0.871-1.376,1.338-2.422,1.401-3.142c0.125-1.187-0.343-1.782-1.401-1.782c-0.498,0-1.012,0.115-1.541,0.341 c1.023-3.35,2.977-4.977,5.862-4.884C21.511,3.066,22.52,4.453,22.396,7.164z"></path></svg>',
'vk' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M22,7.1c0.2,0.4-0.4,1.5-1.6,3.1c-0.2,0.2-0.4,0.5-0.7,0.9c-0.5,0.7-0.9,1.1-0.9,1.4c-0.1,0.3-0.1,0.6,0.1,0.8 c0.1,0.1,0.4,0.4,0.8,0.9h0l0,0c1,0.9,1.6,1.7,2,2.3c0,0,0,0.1,0.1,0.1c0,0.1,0,0.1,0.1,0.3c0,0.1,0,0.2,0,0.4 c0,0.1-0.1,0.2-0.3,0.3c-0.1,0.1-0.4,0.1-0.6,0.1l-2.7,0c-0.2,0-0.4,0-0.6-0.1c-0.2-0.1-0.4-0.1-0.5-0.2l-0.2-0.1 c-0.2-0.1-0.5-0.4-0.7-0.7s-0.5-0.6-0.7-0.8c-0.2-0.2-0.4-0.4-0.6-0.6C14.8,15,14.6,15,14.4,15c0,0,0,0-0.1,0c0,0-0.1,0.1-0.2,0.2 c-0.1,0.1-0.2,0.2-0.2,0.3c-0.1,0.1-0.1,0.3-0.2,0.5c-0.1,0.2-0.1,0.5-0.1,0.8c0,0.1,0,0.2,0,0.3c0,0.1-0.1,0.2-0.1,0.2l0,0.1 c-0.1,0.1-0.3,0.2-0.6,0.2h-1.2c-0.5,0-1,0-1.5-0.2c-0.5-0.1-1-0.3-1.4-0.6s-0.7-0.5-1.1-0.7s-0.6-0.4-0.7-0.6l-0.3-0.3 c-0.1-0.1-0.2-0.2-0.3-0.3s-0.4-0.5-0.7-0.9s-0.7-1-1.1-1.6c-0.4-0.6-0.8-1.3-1.3-2.2C2.9,9.4,2.5,8.5,2.1,7.5C2,7.4,2,7.3,2,7.2 c0-0.1,0-0.1,0-0.2l0-0.1c0.1-0.1,0.3-0.2,0.6-0.2l2.9,0c0.1,0,0.2,0,0.2,0.1S5.9,6.9,5.9,7L6,7c0.1,0.1,0.2,0.2,0.3,0.3 C6.4,7.7,6.5,8,6.7,8.4C6.9,8.8,7,9,7.1,9.2l0.2,0.3c0.2,0.4,0.4,0.8,0.6,1.1c0.2,0.3,0.4,0.5,0.5,0.7s0.3,0.3,0.4,0.4 c0.1,0.1,0.3,0.1,0.4,0.1c0.1,0,0.2,0,0.3-0.1c0,0,0,0,0.1-0.1c0,0,0.1-0.1,0.1-0.2c0.1-0.1,0.1-0.3,0.1-0.5c0-0.2,0.1-0.5,0.1-0.8 c0-0.4,0-0.8,0-1.3c0-0.3,0-0.5-0.1-0.8c0-0.2-0.1-0.4-0.1-0.5L9.6,7.6C9.4,7.3,9.1,7.2,8.7,7.1C8.6,7.1,8.6,7,8.7,6.9 C8.9,6.7,9,6.6,9.1,6.5c0.4-0.2,1.2-0.3,2.5-0.3c0.6,0,1,0.1,1.4,0.1c0.1,0,0.3,0.1,0.3,0.1c0.1,0.1,0.2,0.1,0.2,0.3 c0,0.1,0.1,0.2,0.1,0.3s0,0.3,0,0.5c0,0.2,0,0.4,0,0.6c0,0.2,0,0.4,0,0.7c0,0.3,0,0.6,0,0.9c0,0.1,0,0.2,0,0.4c0,0.2,0,0.4,0,0.5 c0,0.1,0,0.3,0,0.4s0.1,0.3,0.1,0.4c0.1,0.1,0.1,0.2,0.2,0.3c0.1,0,0.1,0,0.2,0c0.1,0,0.2,0,0.3-0.1c0.1-0.1,0.2-0.2,0.4-0.4 s0.3-0.4,0.5-0.7c0.2-0.3,0.5-0.7,0.7-1.1c0.4-0.7,0.8-1.5,1.1-2.3c0-0.1,0.1-0.1,0.1-0.2c0-0.1,0.1-0.1,0.1-0.1l0,0l0.1,0 c0,0,0,0,0.1,0s0.2,0,0.2,0l3,0c0.3,0,0.5,0,0.7,0S21.9,7,21.9,7L22,7.1z"></path></svg>',
'whatsapp' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M16.75,13.96C17,14.09 17.16,14.16 17.21,14.26C17.27,14.37 17.25,14.87 17,15.44C16.8,16 15.76,16.54 15.3,16.56C14.84,16.58 14.83,16.92 12.34,15.83C9.85,14.74 8.35,12.08 8.23,11.91C8.11,11.74 7.27,10.53 7.31,9.3C7.36,8.08 8,7.5 8.26,7.26C8.5,7 8.77,6.97 8.94,7H9.41C9.56,7 9.77,6.94 9.96,7.45L10.65,9.32C10.71,9.45 10.75,9.6 10.66,9.76L10.39,10.17L10,10.59C9.88,10.71 9.74,10.84 9.88,11.09C10,11.35 10.5,12.18 11.2,12.87C12.11,13.75 12.91,14.04 13.15,14.17C13.39,14.31 13.54,14.29 13.69,14.13L14.5,13.19C14.69,12.94 14.85,13 15.08,13.08L16.75,13.96M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C10.03,22 8.2,21.43 6.65,20.45L2,22L3.55,17.35C2.57,15.8 2,13.97 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12C4,13.72 4.54,15.31 5.46,16.61L4.5,19.5L7.39,18.54C8.69,19.46 10.28,20 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z" />
</svg>',
// phpcs:disable WordPress.WP.CapitalPDangit.Misspelled
'wordpress' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M12.158,12.786L9.46,20.625c0.806,0.237,1.657,0.366,2.54,0.366c1.047,0,2.051-0.181,2.986-0.51 c-0.024-0.038-0.046-0.079-0.065-0.124L12.158,12.786z M3.009,12c0,3.559,2.068,6.634,5.067,8.092L3.788,8.341 C3.289,9.459,3.009,10.696,3.009,12z M18.069,11.546c0-1.112-0.399-1.881-0.741-2.48c-0.456-0.741-0.883-1.368-0.883-2.109 c0-0.826,0.627-1.596,1.51-1.596c0.04,0,0.078,0.005,0.116,0.007C16.472,3.904,14.34,3.009,12,3.009 c-3.141,0-5.904,1.612-7.512,4.052c0.211,0.007,0.41,0.011,0.579,0.011c0.94,0,2.396-0.114,2.396-0.114 C7.947,6.93,8.004,7.642,7.52,7.699c0,0-0.487,0.057-1.029,0.085l3.274,9.739l1.968-5.901l-1.401-3.838 C9.848,7.756,9.389,7.699,9.389,7.699C8.904,7.67,8.961,6.93,9.446,6.958c0,0,1.484,0.114,2.368,0.114 c0.94,0,2.397-0.114,2.397-0.114c0.485-0.028,0.542,0.684,0.057,0.741c0,0-0.488,0.057-1.029,0.085l3.249,9.665l0.897-2.996 C17.841,13.284,18.069,12.316,18.069,11.546z M19.889,7.686c0.039,0.286,0.06,0.593,0.06,0.924c0,0.912-0.171,1.938-0.684,3.22 l-2.746,7.94c2.673-1.558,4.47-4.454,4.47-7.771C20.991,10.436,20.591,8.967,19.889,7.686z M12,22C6.486,22,2,17.514,2,12 C2,6.486,6.486,2,12,2c5.514,0,10,4.486,10,10C22,17.514,17.514,22,12,22z"></path></svg>',
'yelp' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M12.271,16.718v1.417q-.011,3.257-.067,3.4a.707.707,0,0,1-.569.446,4.637,4.637,0,0,1-2.024-.424A4.609,4.609,0,0,1,7.8,20.565a.844.844,0,0,1-.19-.4.692.692,0,0,1,.044-.29,3.181,3.181,0,0,1,.379-.524q.335-.412,2.019-2.409.011,0,.669-.781a.757.757,0,0,1,.44-.274.965.965,0,0,1,.552.039.945.945,0,0,1,.418.324.732.732,0,0,1,.139.468Zm-1.662-2.8a.783.783,0,0,1-.58.781l-1.339.435q-3.067.981-3.257.981a.711.711,0,0,1-.6-.4,2.636,2.636,0,0,1-.19-.836,9.134,9.134,0,0,1,.011-1.857,3.559,3.559,0,0,1,.335-1.389.659.659,0,0,1,.625-.357,22.629,22.629,0,0,1,2.253.859q.781.324,1.283.524l.937.379a.771.771,0,0,1,.4.34A.982.982,0,0,1,10.609,13.917Zm9.213,3.313a4.467,4.467,0,0,1-1.021,1.8,4.559,4.559,0,0,1-1.512,1.417.671.671,0,0,1-.7-.078q-.156-.112-2.052-3.2l-.524-.859a.761.761,0,0,1-.128-.513.957.957,0,0,1,.217-.513.774.774,0,0,1,.926-.29q.011.011,1.327.446,2.264.736,2.7.887a2.082,2.082,0,0,1,.524.229.673.673,0,0,1,.245.68Zm-7.5-7.049q.056,1.137-.6,1.361-.647.19-1.272-.792L6.237,4.08a.7.7,0,0,1,.212-.691,5.788,5.788,0,0,1,2.314-1,5.928,5.928,0,0,1,2.5-.352.681.681,0,0,1,.547.5q.034.2.245,3.407T12.327,10.181Zm7.384,1.2a.679.679,0,0,1-.29.658q-.167.112-3.67.959-.747.167-1.015.257l.011-.022a.769.769,0,0,1-.513-.044.914.914,0,0,1-.413-.357.786.786,0,0,1,0-.971q.011-.011.836-1.137,1.394-1.908,1.673-2.275a2.423,2.423,0,0,1,.379-.435A.7.7,0,0,1,17.435,8a4.482,4.482,0,0,1,1.372,1.489,4.81,4.81,0,0,1,.9,1.868v.034Z"></path></svg>',
'youtube' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"></path></svg>',
);
}
}

View File

@ -0,0 +1,142 @@
<?php
/**
* Custom comment walker for this theme.
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
if ( ! class_exists( 'TwentyTwenty_Walker_Comment' ) ) {
/**
* CUSTOM COMMENT WALKER
* A custom walker for comments, based on the walker in Twenty Nineteen.
*/
class TwentyTwenty_Walker_Comment extends Walker_Comment {
/**
* Outputs a comment in the HTML5 format.
*
* @see wp_list_comments()
* @see https://developer.wordpress.org/reference/functions/get_comment_author_url/
* @see https://developer.wordpress.org/reference/functions/get_comment_author/
* @see https://developer.wordpress.org/reference/functions/get_avatar/
* @see https://developer.wordpress.org/reference/functions/get_comment_reply_link/
* @see https://developer.wordpress.org/reference/functions/get_edit_comment_link/
*
* @param WP_Comment $comment Comment to display.
* @param int $depth Depth of the current comment.
* @param array $args An array of arguments.
*/
protected function html5_comment( $comment, $depth, $args ) {
$tag = ( 'div' === $args['style'] ) ? 'div' : 'li';
?>
<<?php echo $tag; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( $this->has_children ? 'parent' : '', $comment ); ?>>
<article id="div-comment-<?php comment_ID(); ?>" class="comment-body">
<footer class="comment-meta">
<div class="comment-author vcard">
<?php
$comment_author_url = get_comment_author_url( $comment );
$comment_author = get_comment_author( $comment );
$avatar = get_avatar( $comment, $args['avatar_size'] );
if ( 0 !== $args['avatar_size'] ) {
if ( empty( $comment_author_url ) ) {
echo wp_kses_post( $avatar );
} else {
printf( '<a href="%s" rel="external nofollow" class="url">', $comment_author_url ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped --Escaped in https://developer.wordpress.org/reference/functions/get_comment_author_url/
echo wp_kses_post( $avatar );
}
}
printf(
'<span class="fn">%1$s</span><span class="screen-reader-text says">%2$s</span>',
esc_html( $comment_author ),
__( 'says:', 'twentytwenty' )
);
if ( ! empty( $comment_author_url ) ) {
echo '</a>';
}
?>
</div><!-- .comment-author -->
<div class="comment-metadata">
<a href="<?php echo esc_url( get_comment_link( $comment, $args ) ); ?>">
<?php
/* translators: 1: Comment date, 2: Comment time. */
$comment_timestamp = sprintf( __( '%1$s at %2$s', 'twentytwenty' ), get_comment_date( '', $comment ), get_comment_time() );
?>
<time datetime="<?php comment_time( 'c' ); ?>" title="<?php echo esc_attr( $comment_timestamp ); ?>">
<?php echo esc_html( $comment_timestamp ); ?>
</time>
</a>
<?php
if ( get_edit_comment_link() ) {
echo ' <span aria-hidden="true">&bull;</span> <a class="comment-edit-link" href="' . esc_url( get_edit_comment_link() ) . '">' . __( 'Edit', 'twentytwenty' ) . '</a>';
}
?>
</div><!-- .comment-metadata -->
</footer><!-- .comment-meta -->
<div class="comment-content entry-content">
<?php
comment_text();
if ( '0' === $comment->comment_approved ) {
?>
<p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentytwenty' ); ?></p>
<?php
}
?>
</div><!-- .comment-content -->
<?php
$comment_reply_link = get_comment_reply_link(
array_merge(
$args,
array(
'add_below' => 'div-comment',
'depth' => $depth,
'max_depth' => $args['max_depth'],
'before' => '<span class="comment-reply">',
'after' => '</span>',
)
)
);
$by_post_author = twentytwenty_is_comment_by_post_author( $comment );
if ( $comment_reply_link || $by_post_author ) {
?>
<footer class="comment-footer-meta">
<?php
if ( $comment_reply_link ) {
echo $comment_reply_link; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Link is escaped in https://developer.wordpress.org/reference/functions/get_comment_reply_link/
}
if ( $by_post_author ) {
echo '<span class="by-post-author">' . __( 'By Post Author', 'twentytwenty' ) . '</span>';
}
?>
</footer>
<?php
}
?>
</article><!-- .comment-body -->
<?php
}
}
}

View File

@ -0,0 +1,146 @@
<?php
/**
* Custom page walker for this theme.
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
if ( ! class_exists( 'TwentyTwenty_Walker_Page' ) ) {
/**
* CUSTOM PAGE WALKER
* A custom walker for pages.
*/
class TwentyTwenty_Walker_Page extends Walker_Page {
/**
* Outputs the beginning of the current element in the tree.
*
* @see Walker::start_el()
* @since 2.1.0
*
* @param string $output Used to append additional content. Passed by reference.
* @param WP_Post $page Page data object.
* @param int $depth Optional. Depth of page. Used for padding. Default 0.
* @param array $args Optional. Array of arguments. Default empty array.
* @param int $current_page Optional. Page ID. Default 0.
*/
public function start_el( &$output, $page, $depth = 0, $args = array(), $current_page = 0 ) {
if ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) {
$t = "\t";
$n = "\n";
} else {
$t = '';
$n = '';
}
if ( $depth ) {
$indent = str_repeat( $t, $depth );
} else {
$indent = '';
}
$css_class = array( 'page_item', 'page-item-' . $page->ID );
if ( isset( $args['pages_with_children'][ $page->ID ] ) ) {
$css_class[] = 'page_item_has_children';
}
if ( ! empty( $current_page ) ) {
$_current_page = get_post( $current_page );
if ( $_current_page && in_array( $page->ID, $_current_page->ancestors, true ) ) {
$css_class[] = 'current_page_ancestor';
}
if ( $page->ID === $current_page ) {
$css_class[] = 'current_page_item';
} elseif ( $_current_page && $page->ID === $_current_page->post_parent ) {
$css_class[] = 'current_page_parent';
}
} elseif ( get_option( 'page_for_posts' ) === $page->ID ) {
$css_class[] = 'current_page_parent';
}
/** This filter is documented in wp-includes/class-walker-page.php */
$css_classes = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) );
$css_classes = $css_classes ? ' class="' . esc_attr( $css_classes ) . '"' : '';
if ( '' === $page->post_title ) {
/* translators: %d: ID of a post. */
$page->post_title = sprintf( __( '#%d (no title)', 'twentytwenty' ), $page->ID );
}
$args['link_before'] = empty( $args['link_before'] ) ? '' : $args['link_before'];
$args['link_after'] = empty( $args['link_after'] ) ? '' : $args['link_after'];
$atts = array();
$atts['href'] = get_permalink( $page->ID );
$atts['aria-current'] = ( $page->ID === $current_page ) ? 'page' : '';
/** This filter is documented in wp-includes/class-walker-page.php */
$atts = apply_filters( 'page_menu_link_attributes', $atts, $page, $depth, $args, $current_page );
$attributes = '';
foreach ( $atts as $attr => $value ) {
if ( ! empty( $value ) ) {
$value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );
$attributes .= ' ' . $attr . '="' . $value . '"';
}
}
$args['list_item_before'] = '';
$args['list_item_after'] = '';
// Wrap the link in a div and append a sub menu toggle.
if ( isset( $args['show_toggles'] ) && true === $args['show_toggles'] ) {
// Wrap the menu item link contents in a div, used for positioning.
$args['list_item_before'] = '<div class="ancestor-wrapper">';
$args['list_item_after'] = '';
// Add a toggle to items with children.
if ( isset( $args['pages_with_children'][ $page->ID ] ) ) {
$toggle_target_string = '.menu-modal .page-item-' . $page->ID . ' > ul';
$toggle_duration = twentytwenty_toggle_duration();
// Add the sub menu toggle.
$args['list_item_after'] .= '<button class="toggle sub-menu-toggle fill-children-current-color" data-toggle-target="' . $toggle_target_string . '" data-toggle-type="slidetoggle" data-toggle-duration="' . absint( $toggle_duration ) . '" aria-expanded="false"><span class="screen-reader-text">' . __( 'Show sub menu', 'twentytwenty' ) . '</span>' . twentytwenty_get_theme_svg( 'chevron-down' ) . '</button>';
}
// Close the wrapper.
$args['list_item_after'] .= '</div><!-- .ancestor-wrapper -->';
}
// Add icons to menu items with children.
if ( isset( $args['show_sub_menu_icons'] ) && true === $args['show_sub_menu_icons'] ) {
if ( isset( $args['pages_with_children'][ $page->ID ] ) ) {
$args['list_item_after'] = '<span class="icon"></span>';
}
}
$output .= $indent . sprintf(
'<li%s>%s<a%s>%s%s%s</a>%s',
$css_classes,
$args['list_item_before'],
$attributes,
$args['link_before'],
/** This filter is documented in wp-includes/post-template.php */
apply_filters( 'the_title', $page->post_title, $page->ID ),
$args['link_after'],
$args['list_item_after']
);
if ( ! empty( $args['show_date'] ) ) {
if ( 'modified' === $args['show_date'] ) {
$time = $page->post_modified;
} else {
$time = $page->post_date;
}
$date_format = empty( $args['date_format'] ) ? '' : $args['date_format'];
$output .= ' ' . mysql2date( $date_format, $time );
}
}
}
}

View File

@ -0,0 +1,132 @@
<?php
/**
* The template file for displaying the comments and comment form for the
* Twenty Twenty theme.
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
/*
* If the current post is protected by a password and
* the visitor has not yet entered the password we will
* return early without loading the comments.
*/
if ( post_password_required() ) {
return;
}
if ( $comments ) {
?>
<div class="comments" id="comments">
<?php
$comments_number = absint( get_comments_number() );
?>
<div class="comments-header section-inner small max-percentage">
<h2 class="comment-reply-title">
<?php
if ( ! have_comments() ) {
_e( 'Leave a comment', 'twentytwenty' );
} elseif ( '1' === $comments_number ) {
/* translators: %s: Post title. */
printf( _x( 'One reply on &ldquo;%s&rdquo;', 'comments title', 'twentytwenty' ), get_the_title() );
} else {
printf(
/* translators: 1: Number of comments, 2: Post title. */
_nx(
'%1$s reply on &ldquo;%2$s&rdquo;',
'%1$s replies on &ldquo;%2$s&rdquo;',
$comments_number,
'comments title',
'twentytwenty'
),
number_format_i18n( $comments_number ),
get_the_title()
);
}
?>
</h2><!-- .comments-title -->
</div><!-- .comments-header -->
<div class="comments-inner section-inner thin max-percentage">
<?php
wp_list_comments(
array(
'walker' => new TwentyTwenty_Walker_Comment(),
'avatar_size' => 120,
'style' => 'div',
)
);
$comment_pagination = paginate_comments_links(
array(
'echo' => false,
'end_size' => 0,
'mid_size' => 0,
'next_text' => __( 'Newer Comments', 'twentytwenty' ) . ' <span aria-hidden="true">&rarr;</span>',
'prev_text' => '<span aria-hidden="true">&larr;</span> ' . __( 'Older Comments', 'twentytwenty' ),
)
);
if ( $comment_pagination ) {
$pagination_classes = '';
// If we're only showing the "Next" link, add a class indicating so.
if ( false === strpos( $comment_pagination, 'prev page-numbers' ) ) {
$pagination_classes = ' only-next';
}
?>
<nav class="comments-pagination pagination<?php echo $pagination_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>" aria-label="<?php esc_attr_e( 'Comments', 'twentytwenty' ); ?>">
<?php echo wp_kses_post( $comment_pagination ); ?>
</nav>
<?php
}
?>
</div><!-- .comments-inner -->
</div><!-- comments -->
<?php
}
if ( comments_open() || pings_open() ) {
if ( $comments ) {
echo '<hr class="styled-separator is-style-wide" aria-hidden="true" />';
}
comment_form(
array(
'class_form' => 'section-inner thin max-percentage',
'title_reply_before' => '<h2 id="reply-title" class="comment-reply-title">',
'title_reply_after' => '</h2>',
)
);
} elseif ( is_single() ) {
if ( $comments ) {
echo '<hr class="styled-separator is-style-wide" aria-hidden="true" />';
}
?>
<div class="comment-respond" id="respond">
<p class="comments-closed"><?php _e( 'Comments are closed.', 'twentytwenty' ); ?></p>
</div><!-- #respond -->
<?php
}

View File

@ -0,0 +1,61 @@
<?php
/**
* The template for displaying the footer
*
* Contains the opening of the #site-footer div and all content after.
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
?>
<footer id="site-footer" role="contentinfo" class="header-footer-group">
<div class="section-inner">
<div class="footer-credits">
<p class="footer-copyright">&copy;
<?php
echo date_i18n(
/* translators: Copyright date format, see https://www.php.net/date */
_x( 'Y', 'copyright date format', 'twentytwenty' )
);
?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a>
</p><!-- .footer-copyright -->
<p class="powered-by-wordpress">
<a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentytwenty' ) ); ?>">
<?php _e( 'Powered by WordPress', 'twentytwenty' ); ?>
</a>
</p><!-- .powered-by-wordpress -->
</div><!-- .footer-credits -->
<a class="to-the-top" href="#site-header">
<span class="to-the-top-long">
<?php
/* translators: %s: HTML character for up arrow. */
printf( __( 'To the top %s', 'twentytwenty' ), '<span class="arrow" aria-hidden="true">&uarr;</span>' );
?>
</span><!-- .to-the-top-long -->
<span class="to-the-top-short">
<?php
/* translators: %s: HTML character for up arrow. */
printf( __( 'Up %s', 'twentytwenty' ), '<span class="arrow" aria-hidden="true">&uarr;</span>' );
?>
</span><!-- .to-the-top-short -->
</a><!-- .to-the-top -->
</div><!-- .section-inner -->
</footer><!-- #site-footer -->
<?php wp_footer(); ?>
</body>
</html>

View File

@ -0,0 +1,760 @@
<?php
/**
* Twenty Twenty functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
/**
* Table of Contents:
* Theme Support
* Required Files
* Register Styles
* Register Scripts
* Register Menus
* Custom Logo
* WP Body Open
* Register Sidebars
* Enqueue Block Editor Assets
* Enqueue Classic Editor Styles
* Block Editor Settings
*/
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function twentytwenty_theme_support() {
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
// Custom background color.
add_theme_support(
'custom-background',
array(
'default-color' => 'f5efe0',
)
);
// Set content-width.
global $content_width;
if ( ! isset( $content_width ) ) {
$content_width = 580;
}
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
// Set post thumbnail size.
set_post_thumbnail_size( 1200, 9999 );
// Add custom image size used in Cover Template.
add_image_size( 'twentytwenty-fullscreen', 1980, 9999 );
// Custom logo.
$logo_width = 120;
$logo_height = 90;
// If the retina setting is active, double the recommended width and height.
if ( get_theme_mod( 'retina_logo', false ) ) {
$logo_width = floor( $logo_width * 2 );
$logo_height = floor( $logo_height * 2 );
}
add_theme_support(
'custom-logo',
array(
'height' => $logo_height,
'width' => $logo_width,
'flex-height' => true,
'flex-width' => true,
)
);
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support(
'html5',
array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
'script',
'style',
)
);
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Twenty Twenty, use a find and replace
* to change 'twentytwenty' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'twentytwenty' );
// Add support for full and wide align images.
add_theme_support( 'align-wide' );
// Add support for responsive embeds.
add_theme_support( 'responsive-embeds' );
/*
* Adds starter content to highlight the theme on fresh sites.
* This is done conditionally to avoid loading the starter content on every
* page load, as it is a one-off operation only needed once in the customizer.
*/
if ( is_customize_preview() ) {
require get_template_directory() . '/inc/starter-content.php';
add_theme_support( 'starter-content', twentytwenty_get_starter_content() );
}
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
/*
* Adds `async` and `defer` support for scripts registered or enqueued
* by the theme.
*/
$loader = new TwentyTwenty_Script_Loader();
add_filter( 'script_loader_tag', array( $loader, 'filter_script_loader_tag' ), 10, 2 );
}
add_action( 'after_setup_theme', 'twentytwenty_theme_support' );
/**
* REQUIRED FILES
* Include required files.
*/
require get_template_directory() . '/inc/template-tags.php';
// Handle SVG icons.
require get_template_directory() . '/classes/class-twentytwenty-svg-icons.php';
require get_template_directory() . '/inc/svg-icons.php';
// Handle Customizer settings.
require get_template_directory() . '/classes/class-twentytwenty-customize.php';
// Require Separator Control class.
require get_template_directory() . '/classes/class-twentytwenty-separator-control.php';
// Custom comment walker.
require get_template_directory() . '/classes/class-twentytwenty-walker-comment.php';
// Custom page walker.
require get_template_directory() . '/classes/class-twentytwenty-walker-page.php';
// Custom script loader class.
require get_template_directory() . '/classes/class-twentytwenty-script-loader.php';
// Non-latin language handling.
require get_template_directory() . '/classes/class-twentytwenty-non-latin-languages.php';
// Custom CSS.
require get_template_directory() . '/inc/custom-css.php';
/**
* Register and Enqueue Styles.
*/
function twentytwenty_register_styles() {
$theme_version = wp_get_theme()->get( 'Version' );
wp_enqueue_style( 'twentytwenty-style', get_stylesheet_uri(), array(), $theme_version );
wp_style_add_data( 'twentytwenty-style', 'rtl', 'replace' );
// Add output of Customizer settings as inline style.
wp_add_inline_style( 'twentytwenty-style', twentytwenty_get_customizer_css( 'front-end' ) );
// Add print CSS.
wp_enqueue_style( 'twentytwenty-print-style', get_template_directory_uri() . '/print.css', null, $theme_version, 'print' );
}
add_action( 'wp_enqueue_scripts', 'twentytwenty_register_styles' );
/**
* Register and Enqueue Scripts.
*/
function twentytwenty_register_scripts() {
$theme_version = wp_get_theme()->get( 'Version' );
if ( ( ! is_admin() ) && is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
wp_enqueue_script( 'twentytwenty-js', get_template_directory_uri() . '/assets/js/index.js', array(), $theme_version, false );
wp_script_add_data( 'twentytwenty-js', 'async', true );
}
add_action( 'wp_enqueue_scripts', 'twentytwenty_register_scripts' );
/**
* Fix skip link focus in IE11.
*
* This does not enqueue the script because it is tiny and because it is only for IE11,
* thus it does not warrant having an entire dedicated blocking script being loaded.
*
* @link https://git.io/vWdr2
*/
function twentytwenty_skip_link_focus_fix() {
// The following is minified via `terser --compress --mangle -- assets/js/skip-link-focus-fix.js`.
?>
<script>
/(trident|msie)/i.test(navigator.userAgent)&&document.getElementById&&window.addEventListener&&window.addEventListener("hashchange",function(){var t,e=location.hash.substring(1);/^[A-z0-9_-]+$/.test(e)&&(t=document.getElementById(e))&&(/^(?:a|select|input|button|textarea)$/i.test(t.tagName)||(t.tabIndex=-1),t.focus())},!1);
</script>
<?php
}
add_action( 'wp_print_footer_scripts', 'twentytwenty_skip_link_focus_fix' );
/** Enqueue non-latin language styles
*
* @since Twenty Twenty 1.0
*
* @return void
*/
function twentytwenty_non_latin_languages() {
$custom_css = TwentyTwenty_Non_Latin_Languages::get_non_latin_css( 'front-end' );
if ( $custom_css ) {
wp_add_inline_style( 'twentytwenty-style', $custom_css );
}
}
add_action( 'wp_enqueue_scripts', 'twentytwenty_non_latin_languages' );
/**
* Register navigation menus uses wp_nav_menu in five places.
*/
function twentytwenty_menus() {
$locations = array(
'primary' => __( 'Desktop Horizontal Menu', 'twentytwenty' ),
'expanded' => __( 'Desktop Expanded Menu', 'twentytwenty' ),
'mobile' => __( 'Mobile Menu', 'twentytwenty' ),
'footer' => __( 'Footer Menu', 'twentytwenty' ),
'social' => __( 'Social Menu', 'twentytwenty' ),
);
register_nav_menus( $locations );
}
add_action( 'init', 'twentytwenty_menus' );
/**
* Get the information about the logo.
*
* @param string $html The HTML output from get_custom_logo (core function).
*
* @return string $html
*/
function twentytwenty_get_custom_logo( $html ) {
$logo_id = get_theme_mod( 'custom_logo' );
if ( ! $logo_id ) {
return $html;
}
$logo = wp_get_attachment_image_src( $logo_id, 'full' );
if ( $logo ) {
// For clarity.
$logo_width = esc_attr( $logo[1] );
$logo_height = esc_attr( $logo[2] );
// If the retina logo setting is active, reduce the width/height by half.
if ( get_theme_mod( 'retina_logo', false ) ) {
$logo_width = floor( $logo_width / 2 );
$logo_height = floor( $logo_height / 2 );
$search = array(
'/width=\"\d+\"/iU',
'/height=\"\d+\"/iU',
);
$replace = array(
"width=\"{$logo_width}\"",
"height=\"{$logo_height}\"",
);
// Add a style attribute with the height, or append the height to the style attribute if the style attribute already exists.
if ( strpos( $html, ' style=' ) === false ) {
$search[] = '/(src=)/';
$replace[] = "style=\"height: {$logo_height}px;\" src=";
} else {
$search[] = '/(style="[^"]*)/';
$replace[] = "$1 height: {$logo_height}px;";
}
$html = preg_replace( $search, $replace, $html );
}
}
return $html;
}
add_filter( 'get_custom_logo', 'twentytwenty_get_custom_logo' );
if ( ! function_exists( 'wp_body_open' ) ) {
/**
* Shim for wp_body_open, ensuring backward compatibility with versions of WordPress older than 5.2.
*/
function wp_body_open() {
do_action( 'wp_body_open' );
}
}
/**
* Include a skip to content link at the top of the page so that users can bypass the menu.
*/
function twentytwenty_skip_link() {
echo '<a class="skip-link screen-reader-text" href="#site-content">' . __( 'Skip to the content', 'twentytwenty' ) . '</a>';
}
add_action( 'wp_body_open', 'twentytwenty_skip_link', 5 );
/**
* Register widget areas.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function twentytwenty_sidebar_registration() {
// Arguments used in all register_sidebar() calls.
$shared_args = array(
'before_title' => '<h2 class="widget-title subheading heading-size-3">',
'after_title' => '</h2>',
'before_widget' => '<div class="widget %2$s"><div class="widget-content">',
'after_widget' => '</div></div>',
);
// Footer #1.
register_sidebar(
array_merge(
$shared_args,
array(
'name' => __( 'Footer #1', 'twentytwenty' ),
'id' => 'sidebar-1',
'description' => __( 'Widgets in this area will be displayed in the first column in the footer.', 'twentytwenty' ),
)
)
);
// Footer #2.
register_sidebar(
array_merge(
$shared_args,
array(
'name' => __( 'Footer #2', 'twentytwenty' ),
'id' => 'sidebar-2',
'description' => __( 'Widgets in this area will be displayed in the second column in the footer.', 'twentytwenty' ),
)
)
);
}
add_action( 'widgets_init', 'twentytwenty_sidebar_registration' );
/**
* Enqueue supplemental block editor styles.
*/
function twentytwenty_block_editor_styles() {
$css_dependencies = array();
// Enqueue the editor styles.
wp_enqueue_style( 'twentytwenty-block-editor-styles', get_theme_file_uri( '/assets/css/editor-style-block.css' ), $css_dependencies, wp_get_theme()->get( 'Version' ), 'all' );
wp_style_add_data( 'twentytwenty-block-editor-styles', 'rtl', 'replace' );
// Add inline style from the Customizer.
wp_add_inline_style( 'twentytwenty-block-editor-styles', twentytwenty_get_customizer_css( 'block-editor' ) );
// Add inline style for non-latin fonts.
wp_add_inline_style( 'twentytwenty-block-editor-styles', TwentyTwenty_Non_Latin_Languages::get_non_latin_css( 'block-editor' ) );
// Enqueue the editor script.
wp_enqueue_script( 'twentytwenty-block-editor-script', get_theme_file_uri( '/assets/js/editor-script-block.js' ), array( 'wp-blocks', 'wp-dom' ), wp_get_theme()->get( 'Version' ), true );
}
add_action( 'enqueue_block_editor_assets', 'twentytwenty_block_editor_styles', 1, 1 );
/**
* Enqueue classic editor styles.
*/
function twentytwenty_classic_editor_styles() {
$classic_editor_styles = array(
'/assets/css/editor-style-classic.css',
);
add_editor_style( $classic_editor_styles );
}
add_action( 'init', 'twentytwenty_classic_editor_styles' );
/**
* Output Customizer settings in the classic editor.
* Adds styles to the head of the TinyMCE iframe. Kudos to @Otto42 for the original solution.
*
* @param array $mce_init TinyMCE styles.
*
* @return array $mce_init TinyMCE styles.
*/
function twentytwenty_add_classic_editor_customizer_styles( $mce_init ) {
$styles = twentytwenty_get_customizer_css( 'classic-editor' );
if ( ! isset( $mce_init['content_style'] ) ) {
$mce_init['content_style'] = $styles . ' ';
} else {
$mce_init['content_style'] .= ' ' . $styles . ' ';
}
return $mce_init;
}
add_filter( 'tiny_mce_before_init', 'twentytwenty_add_classic_editor_customizer_styles' );
/**
* Output non-latin font styles in the classic editor.
* Adds styles to the head of the TinyMCE iframe. Kudos to @Otto42 for the original solution.
*
* @param array $mce_init TinyMCE styles.
*
* @return array $mce_init TinyMCE styles.
*/
function twentytwenty_add_classic_editor_non_latin_styles( $mce_init ) {
$styles = TwentyTwenty_Non_Latin_Languages::get_non_latin_css( 'classic-editor' );
// Return if there are no styles to add.
if ( ! $styles ) {
return $mce_init;
}
if ( ! isset( $mce_init['content_style'] ) ) {
$mce_init['content_style'] = $styles . ' ';
} else {
$mce_init['content_style'] .= ' ' . $styles . ' ';
}
return $mce_init;
}
add_filter( 'tiny_mce_before_init', 'twentytwenty_add_classic_editor_non_latin_styles' );
/**
* Block Editor Settings.
* Add custom colors and font sizes to the block editor.
*/
function twentytwenty_block_editor_settings() {
// Block Editor Palette.
$editor_color_palette = array(
array(
'name' => __( 'Accent Color', 'twentytwenty' ),
'slug' => 'accent',
'color' => twentytwenty_get_color_for_area( 'content', 'accent' ),
),
array(
'name' => __( 'Primary', 'twentytwenty' ),
'slug' => 'primary',
'color' => twentytwenty_get_color_for_area( 'content', 'text' ),
),
array(
'name' => __( 'Secondary', 'twentytwenty' ),
'slug' => 'secondary',
'color' => twentytwenty_get_color_for_area( 'content', 'secondary' ),
),
array(
'name' => __( 'Subtle Background', 'twentytwenty' ),
'slug' => 'subtle-background',
'color' => twentytwenty_get_color_for_area( 'content', 'borders' ),
),
);
// Add the background option.
$background_color = get_theme_mod( 'background_color' );
if ( ! $background_color ) {
$background_color_arr = get_theme_support( 'custom-background' );
$background_color = $background_color_arr[0]['default-color'];
}
$editor_color_palette[] = array(
'name' => __( 'Background Color', 'twentytwenty' ),
'slug' => 'background',
'color' => '#' . $background_color,
);
// If we have accent colors, add them to the block editor palette.
if ( $editor_color_palette ) {
add_theme_support( 'editor-color-palette', $editor_color_palette );
}
// Block Editor Font Sizes.
add_theme_support(
'editor-font-sizes',
array(
array(
'name' => _x( 'Small', 'Name of the small font size in the block editor', 'twentytwenty' ),
'shortName' => _x( 'S', 'Short name of the small font size in the block editor.', 'twentytwenty' ),
'size' => 18,
'slug' => 'small',
),
array(
'name' => _x( 'Regular', 'Name of the regular font size in the block editor', 'twentytwenty' ),
'shortName' => _x( 'M', 'Short name of the regular font size in the block editor.', 'twentytwenty' ),
'size' => 21,
'slug' => 'normal',
),
array(
'name' => _x( 'Large', 'Name of the large font size in the block editor', 'twentytwenty' ),
'shortName' => _x( 'L', 'Short name of the large font size in the block editor.', 'twentytwenty' ),
'size' => 26.25,
'slug' => 'large',
),
array(
'name' => _x( 'Larger', 'Name of the larger font size in the block editor', 'twentytwenty' ),
'shortName' => _x( 'XL', 'Short name of the larger font size in the block editor.', 'twentytwenty' ),
'size' => 32,
'slug' => 'larger',
),
)
);
// If we have a dark background color then add support for dark editor style.
// We can determine if the background color is dark by checking if the text-color is white.
if ( '#ffffff' === strtolower( twentytwenty_get_color_for_area( 'content', 'text' ) ) ) {
add_theme_support( 'dark-editor-style' );
}
}
add_action( 'after_setup_theme', 'twentytwenty_block_editor_settings' );
/**
* Overwrite default more tag with styling and screen reader markup.
*
* @param string $html The default output HTML for the more tag.
*
* @return string $html
*/
function twentytwenty_read_more_tag( $html ) {
return preg_replace( '/<a(.*)>(.*)<\/a>/iU', sprintf( '<div class="read-more-button-wrap"><a$1><span class="faux-button">$2</span> <span class="screen-reader-text">"%1$s"</span></a></div>', get_the_title( get_the_ID() ) ), $html );
}
add_filter( 'the_content_more_link', 'twentytwenty_read_more_tag' );
/**
* Enqueues scripts for customizer controls & settings.
*
* @since Twenty Twenty 1.0
*
* @return void
*/
function twentytwenty_customize_controls_enqueue_scripts() {
$theme_version = wp_get_theme()->get( 'Version' );
// Add main customizer js file.
wp_enqueue_script( 'twentytwenty-customize', get_template_directory_uri() . '/assets/js/customize.js', array( 'jquery' ), $theme_version, false );
// Add script for color calculations.
wp_enqueue_script( 'twentytwenty-color-calculations', get_template_directory_uri() . '/assets/js/color-calculations.js', array( 'wp-color-picker' ), $theme_version, false );
// Add script for controls.
wp_enqueue_script( 'twentytwenty-customize-controls', get_template_directory_uri() . '/assets/js/customize-controls.js', array( 'twentytwenty-color-calculations', 'customize-controls', 'underscore', 'jquery' ), $theme_version, false );
wp_localize_script( 'twentytwenty-customize-controls', 'twentyTwentyBgColors', twentytwenty_get_customizer_color_vars() );
}
add_action( 'customize_controls_enqueue_scripts', 'twentytwenty_customize_controls_enqueue_scripts' );
/**
* Enqueue scripts for the customizer preview.
*
* @since Twenty Twenty 1.0
*
* @return void
*/
function twentytwenty_customize_preview_init() {
$theme_version = wp_get_theme()->get( 'Version' );
wp_enqueue_script( 'twentytwenty-customize-preview', get_theme_file_uri( '/assets/js/customize-preview.js' ), array( 'customize-preview', 'customize-selective-refresh', 'jquery' ), $theme_version, true );
wp_localize_script( 'twentytwenty-customize-preview', 'twentyTwentyBgColors', twentytwenty_get_customizer_color_vars() );
wp_localize_script( 'twentytwenty-customize-preview', 'twentyTwentyPreviewEls', twentytwenty_get_elements_array() );
wp_add_inline_script(
'twentytwenty-customize-preview',
sprintf(
'wp.customize.selectiveRefresh.partialConstructor[ %1$s ].prototype.attrs = %2$s;',
wp_json_encode( 'cover_opacity' ),
wp_json_encode( twentytwenty_customize_opacity_range() )
)
);
}
add_action( 'customize_preview_init', 'twentytwenty_customize_preview_init' );
/**
* Get accessible color for an area.
*
* @since Twenty Twenty 1.0
*
* @param string $area The area we want to get the colors for.
* @param string $context Can be 'text' or 'accent'.
* @return string Returns a HEX color.
*/
function twentytwenty_get_color_for_area( $area = 'content', $context = 'text' ) {
// Get the value from the theme-mod.
$settings = get_theme_mod(
'accent_accessible_colors',
array(
'content' => array(
'text' => '#000000',
'accent' => '#cd2653',
'secondary' => '#6d6d6d',
'borders' => '#dcd7ca',
),
'header-footer' => array(
'text' => '#000000',
'accent' => '#cd2653',
'secondary' => '#6d6d6d',
'borders' => '#dcd7ca',
),
)
);
// If we have a value return it.
if ( isset( $settings[ $area ] ) && isset( $settings[ $area ][ $context ] ) ) {
return $settings[ $area ][ $context ];
}
// Return false if the option doesn't exist.
return false;
}
/**
* Returns an array of variables for the customizer preview.
*
* @since Twenty Twenty 1.0
*
* @return array
*/
function twentytwenty_get_customizer_color_vars() {
$colors = array(
'content' => array(
'setting' => 'background_color',
),
'header-footer' => array(
'setting' => 'header_footer_background_color',
),
);
return $colors;
}
/**
* Get an array of elements.
*
* @since Twenty Twenty 1.0
*
* @return array
*/
function twentytwenty_get_elements_array() {
// The array is formatted like this:
// [key-in-saved-setting][sub-key-in-setting][css-property] = [elements].
$elements = array(
'content' => array(
'accent' => array(
'color' => array( '.color-accent', '.color-accent-hover:hover', '.color-accent-hover:focus', ':root .has-accent-color', '.has-drop-cap:not(:focus):first-letter', '.wp-block-button.is-style-outline', 'a' ),
'border-color' => array( 'blockquote', '.border-color-accent', '.border-color-accent-hover:hover', '.border-color-accent-hover:focus' ),
'background-color' => array( 'button:not(.toggle)', '.button', '.faux-button', '.wp-block-button__link', '.wp-block-file .wp-block-file__button', 'input[type="button"]', 'input[type="reset"]', 'input[type="submit"]', '.bg-accent', '.bg-accent-hover:hover', '.bg-accent-hover:focus', ':root .has-accent-background-color', '.comment-reply-link' ),
'fill' => array( '.fill-children-accent', '.fill-children-accent *' ),
),
'background' => array(
'color' => array( ':root .has-background-color', 'button', '.button', '.faux-button', '.wp-block-button__link', '.wp-block-file__button', 'input[type="button"]', 'input[type="reset"]', 'input[type="submit"]', '.wp-block-button', '.comment-reply-link', '.has-background.has-primary-background-color:not(.has-text-color)', '.has-background.has-primary-background-color *:not(.has-text-color)', '.has-background.has-accent-background-color:not(.has-text-color)', '.has-background.has-accent-background-color *:not(.has-text-color)' ),
'background-color' => array( ':root .has-background-background-color' ),
),
'text' => array(
'color' => array( 'body', '.entry-title a', ':root .has-primary-color' ),
'background-color' => array( ':root .has-primary-background-color' ),
),
'secondary' => array(
'color' => array( 'cite', 'figcaption', '.wp-caption-text', '.post-meta', '.entry-content .wp-block-archives li', '.entry-content .wp-block-categories li', '.entry-content .wp-block-latest-posts li', '.wp-block-latest-comments__comment-date', '.wp-block-latest-posts__post-date', '.wp-block-embed figcaption', '.wp-block-image figcaption', '.wp-block-pullquote cite', '.comment-metadata', '.comment-respond .comment-notes', '.comment-respond .logged-in-as', '.pagination .dots', '.entry-content hr:not(.has-background)', 'hr.styled-separator', ':root .has-secondary-color' ),
'background-color' => array( ':root .has-secondary-background-color' ),
),
'borders' => array(
'border-color' => array( 'pre', 'fieldset', 'input', 'textarea', 'table', 'table *', 'hr' ),
'background-color' => array( 'caption', 'code', 'code', 'kbd', 'samp', '.wp-block-table.is-style-stripes tbody tr:nth-child(odd)', ':root .has-subtle-background-background-color' ),
'border-bottom-color' => array( '.wp-block-table.is-style-stripes' ),
'border-top-color' => array( '.wp-block-latest-posts.is-grid li' ),
'color' => array( ':root .has-subtle-background-color' ),
),
),
'header-footer' => array(
'accent' => array(
'color' => array( 'body:not(.overlay-header) .primary-menu > li > a', 'body:not(.overlay-header) .primary-menu > li > .icon', '.modal-menu a', '.footer-menu a, .footer-widgets a', '#site-footer .wp-block-button.is-style-outline', '.wp-block-pullquote:before', '.singular:not(.overlay-header) .entry-header a', '.archive-header a', '.header-footer-group .color-accent', '.header-footer-group .color-accent-hover:hover' ),
'background-color' => array( '.social-icons a', '#site-footer button:not(.toggle)', '#site-footer .button', '#site-footer .faux-button', '#site-footer .wp-block-button__link', '#site-footer .wp-block-file__button', '#site-footer input[type="button"]', '#site-footer input[type="reset"]', '#site-footer input[type="submit"]' ),
),
'background' => array(
'color' => array( '.social-icons a', 'body:not(.overlay-header) .primary-menu ul', '.header-footer-group button', '.header-footer-group .button', '.header-footer-group .faux-button', '.header-footer-group .wp-block-button:not(.is-style-outline) .wp-block-button__link', '.header-footer-group .wp-block-file__button', '.header-footer-group input[type="button"]', '.header-footer-group input[type="reset"]', '.header-footer-group input[type="submit"]' ),
'background-color' => array( '#site-header', '.footer-nav-widgets-wrapper', '#site-footer', '.menu-modal', '.menu-modal-inner', '.search-modal-inner', '.archive-header', '.singular .entry-header', '.singular .featured-media:before', '.wp-block-pullquote:before' ),
),
'text' => array(
'color' => array( '.header-footer-group', 'body:not(.overlay-header) #site-header .toggle', '.menu-modal .toggle' ),
'background-color' => array( 'body:not(.overlay-header) .primary-menu ul' ),
'border-bottom-color' => array( 'body:not(.overlay-header) .primary-menu > li > ul:after' ),
'border-left-color' => array( 'body:not(.overlay-header) .primary-menu ul ul:after' ),
),
'secondary' => array(
'color' => array( '.site-description', 'body:not(.overlay-header) .toggle-inner .toggle-text', '.widget .post-date', '.widget .rss-date', '.widget_archive li', '.widget_categories li', '.widget cite', '.widget_pages li', '.widget_meta li', '.widget_nav_menu li', '.powered-by-wordpress', '.to-the-top', '.singular .entry-header .post-meta', '.singular:not(.overlay-header) .entry-header .post-meta a' ),
),
'borders' => array(
'border-color' => array( '.header-footer-group pre', '.header-footer-group fieldset', '.header-footer-group input', '.header-footer-group textarea', '.header-footer-group table', '.header-footer-group table *', '.footer-nav-widgets-wrapper', '#site-footer', '.menu-modal nav *', '.footer-widgets-outer-wrapper', '.footer-top' ),
'background-color' => array( '.header-footer-group table caption', 'body:not(.overlay-header) .header-inner .toggle-wrapper::before' ),
),
),
);
/**
* Filters Twenty Twenty theme elements
*
* @since Twenty Twenty 1.0
*
* @param array Array of elements
*/
return apply_filters( 'twentytwenty_get_elements_array', $elements );
}

View File

@ -0,0 +1,187 @@
<?php
/**
* Header file for the Twenty Twenty WordPress default theme.
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
?><!DOCTYPE html>
<html class="no-js" <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'La Mine' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0" >
<link rel="profile" href="https://gmpg.org/xfn/11">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php
wp_body_open();
?>
<header id="site-header" class="header-footer-group" role="banner">
<div class="header-inner section-inner">
<div class="header-titles-wrapper">
<?php
// Check whether the header search is activated in the customizer.
$enable_header_search = get_theme_mod( 'enable_header_search', true );
if ( true === $enable_header_search ) {
?>
<button class="toggle search-toggle mobile-search-toggle" data-toggle-target=".search-modal" data-toggle-body-class="showing-search-modal" data-set-focus=".search-modal .search-field" aria-expanded="false">
<span class="toggle-inner">
<span class="toggle-icon">
<?php twentytwenty_the_theme_svg( 'search' ); ?>
</span>
<span class="toggle-text"><?php _e( 'Search', 'twentytwenty' ); ?></span>
</span>
</button><!-- .search-toggle -->
<?php } ?>
<div class="header-titles">
<?php
// Site title or logo.
twentytwenty_site_logo();
// Site description.
twentytwenty_site_description();
?>
</div><!-- .header-titles -->
<button class="toggle nav-toggle mobile-nav-toggle" data-toggle-target=".menu-modal" data-toggle-body-class="showing-menu-modal" aria-expanded="false" data-set-focus=".close-nav-toggle">
<span class="toggle-inner">
<span class="toggle-icon">
<?php twentytwenty_the_theme_svg( 'ellipsis' ); ?>
</span>
<span class="toggle-text"><?php _e( 'Menu', 'twentytwenty' ); ?></span>
</span>
</button><!-- .nav-toggle -->
</div><!-- .header-titles-wrapper -->
<div class="header-navigation-wrapper">
<?php
if ( has_nav_menu( 'primary' ) || ! has_nav_menu( 'expanded' ) ) {
?>
<nav class="primary-menu-wrapper" aria-label="<?php esc_attr_e( 'Horizontal', 'twentytwenty' ); ?>" role="navigation">
<ul class="primary-menu reset-list-style">
<?php
if ( has_nav_menu( 'primary' ) ) {
wp_nav_menu(
array(
'container' => '',
'items_wrap' => '%3$s',
'theme_location' => 'primary',
)
);
} elseif ( ! has_nav_menu( 'expanded' ) ) {
wp_list_pages(
array(
'match_menu_classes' => true,
'show_sub_menu_icons' => true,
'title_li' => false,
'walker' => new TwentyTwenty_Walker_Page(),
)
);
}
?>
</ul>
</nav><!-- .primary-menu-wrapper -->
<?php
}
if ( true === $enable_header_search || has_nav_menu( 'expanded' ) ) {
?>
<div class="header-toggles hide-no-js">
<?php
if ( has_nav_menu( 'expanded' ) ) {
?>
<div class="toggle-wrapper nav-toggle-wrapper has-expanded-menu">
<button class="toggle nav-toggle desktop-nav-toggle" data-toggle-target=".menu-modal" data-toggle-body-class="showing-menu-modal" aria-expanded="false" data-set-focus=".close-nav-toggle">
<span class="toggle-inner">
<span class="toggle-text"><?php _e( 'Menu', 'twentytwenty' ); ?></span>
<span class="toggle-icon">
<?php twentytwenty_the_theme_svg( 'ellipsis' ); ?>
</span>
</span>
</button><!-- .nav-toggle -->
</div><!-- .nav-toggle-wrapper -->
<?php
}
if ( true === $enable_header_search ) {
?>
<div class="toggle-wrapper search-toggle-wrapper">
<button class="toggle search-toggle desktop-search-toggle" data-toggle-target=".search-modal" data-toggle-body-class="showing-search-modal" data-set-focus=".search-modal .search-field" aria-expanded="false">
<span class="toggle-inner">
<?php twentytwenty_the_theme_svg( 'search' ); ?>
<span class="toggle-text"><?php _e( 'Search', 'twentytwenty' ); ?></span>
</span>
</button><!-- .search-toggle -->
</div>
<?php
}
?>
</div><!-- .header-toggles -->
<?php
}
?>
</div><!-- .header-navigation-wrapper -->
</div><!-- .header-inner -->
<?php
// Output the search modal (if it is activated in the customizer).
if ( true === $enable_header_search ) {
get_template_part( 'template-parts/modal-search' );
}
?>
</header><!-- #site-header -->
<?php
// Output the menu modal.
get_template_part( 'template-parts/modal-menu' );

View File

@ -0,0 +1,191 @@
<?php
/**
* Twenty Twenty Custom CSS
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
if ( ! function_exists( 'twentytwenty_generate_css' ) ) {
/**
* Generate CSS.
*
* @param string $selector The CSS selector.
* @param string $style The CSS style.
* @param string $value The CSS value.
* @param string $prefix The CSS prefix.
* @param string $suffix The CSS suffix.
* @param bool $echo Echo the styles.
*/
function twentytwenty_generate_css( $selector, $style, $value, $prefix = '', $suffix = '', $echo = true ) {
$return = '';
/*
* Bail early if we have no $selector elements or properties and $value.
*/
if ( ! $value || ! $selector ) {
return;
}
$return = sprintf( '%s { %s: %s; }', $selector, $style, $prefix . $value . $suffix );
if ( $echo ) {
echo $return; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- We need to double check this, but for now, we want to pass PHPCS ;)
}
return $return;
}
}
if ( ! function_exists( 'twentytwenty_get_customizer_css' ) ) {
/**
* Get CSS Built from Customizer Options.
* Build CSS reflecting colors, fonts and other options set in the Customizer, and return them for output.
*
* @param string $type Whether to return CSS for the "front-end", "block-editor" or "classic-editor".
*/
function twentytwenty_get_customizer_css( $type = 'front-end' ) {
// Get variables.
$body = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'text' ) );
$body_default = '#000000';
$secondary = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'secondary' ) );
$secondary_default = '#6d6d6d';
$borders = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'borders' ) );
$borders_default = '#dcd7ca';
$accent = sanitize_hex_color( twentytwenty_get_color_for_area( 'content', 'accent' ) );
$accent_default = '#cd2653';
// Header.
$header_footer_background = sanitize_hex_color( twentytwenty_get_color_for_area( 'header-footer', 'background' ) );
$header_footer_background_default = '#ffffff';
// Cover.
$cover = sanitize_hex_color( get_theme_mod( 'cover_template_overlay_text_color' ) );
$cover_default = '#ffffff';
// Background.
$background = sanitize_hex_color_no_hash( get_theme_mod( 'background_color' ) );
$background_default = 'f5efe0';
ob_start();
/**
* Note Styles are applied in this order:
* 1. Element specific
* 2. Helper classes
*
* This enables all helper classes to overwrite base element styles,
* meaning that any color classes applied in the block editor will
* have a higher priority than the base element styles.
*/
// Front-End Styles.
if ( 'front-end' === $type ) {
// Auto-calculated colors.
$elements_definitions = twentytwenty_get_elements_array();
foreach ( $elements_definitions as $context => $props ) {
foreach ( $props as $key => $definitions ) {
foreach ( $definitions as $property => $elements ) {
/*
* If we don't have an elements array or it is empty
* then skip this iteration early;
*/
if ( ! is_array( $elements ) || empty( $elements ) ) {
continue;
}
$val = twentytwenty_get_color_for_area( $context, $key );
if ( $val ) {
twentytwenty_generate_css( implode( ',', $elements ), $property, $val );
}
}
}
}
if ( $cover && $cover !== $cover_default ) {
twentytwenty_generate_css( '.overlay-header .header-inner', 'color', $cover );
twentytwenty_generate_css( '.cover-header .entry-header *', 'color', $cover );
}
// Block Editor Styles.
} elseif ( 'block-editor' === $type ) {
// Colors.
// Accent color.
if ( $accent && $accent !== $accent_default ) {
twentytwenty_generate_css( '.has-accent-color, .editor-styles-wrapper .editor-block-list__layout a, .editor-styles-wrapper .has-drop-cap:not(:focus)::first-letter, .editor-styles-wrapper .wp-block-button.is-style-outline .wp-block-button__link, .editor-styles-wrapper .wp-block-pullquote::before, .editor-styles-wrapper .wp-block-file .wp-block-file__textlink', 'color', $accent );
twentytwenty_generate_css( '.editor-styles-wrapper .wp-block-quote', 'border-color', $accent, '' );
twentytwenty_generate_css( '.has-accent-background-color, .editor-styles-wrapper .wp-block-button__link, .editor-styles-wrapper .wp-block-file__button', 'background-color', $accent );
}
// Background color.
if ( $background && $background !== $background_default ) {
twentytwenty_generate_css( '.editor-styles-wrapper', 'background-color', '#' . $background );
twentytwenty_generate_css( '.has-background.has-primary-background-color:not(.has-text-color),.has-background.has-primary-background-color *:not(.has-text-color),.has-background.has-accent-background-color:not(.has-text-color),.has-background.has-accent-background-color *:not(.has-text-color)', 'color', '#' . $background );
}
// Borders color.
if ( $borders && $borders !== $borders_default ) {
twentytwenty_generate_css( '.editor-styles-wrapper .wp-block-code, .editor-styles-wrapper pre, .editor-styles-wrapper .wp-block-preformatted pre, .editor-styles-wrapper .wp-block-verse pre, .editor-styles-wrapper fieldset, .editor-styles-wrapper .wp-block-table, .editor-styles-wrapper .wp-block-table *, .editor-styles-wrapper .wp-block-table.is-style-stripes, .editor-styles-wrapper .wp-block-latest-posts.is-grid li', 'border-color', $borders );
twentytwenty_generate_css( '.editor-styles-wrapper .wp-block-table caption, .editor-styles-wrapper .wp-block-table.is-style-stripes tbody tr:nth-child(odd)', 'background-color', $borders );
}
// Text color.
if ( $body && $body !== $body_default ) {
twentytwenty_generate_css( 'body .editor-styles-wrapper, .editor-post-title__block .editor-post-title__input, .editor-post-title__block .editor-post-title__input:focus', 'color', $body );
}
// Secondary color.
if ( $secondary && $secondary !== $secondary_default ) {
twentytwenty_generate_css( '.editor-styles-wrapper figcaption, .editor-styles-wrapper cite, .editor-styles-wrapper .wp-block-quote__citation, .editor-styles-wrapper .wp-block-quote cite, .editor-styles-wrapper .wp-block-quote footer, .editor-styles-wrapper .wp-block-pullquote__citation, .editor-styles-wrapper .wp-block-pullquote cite, .editor-styles-wrapper .wp-block-pullquote footer, .editor-styles-wrapper ul.wp-block-archives li, .editor-styles-wrapper ul.wp-block-categories li, .editor-styles-wrapper ul.wp-block-latest-posts li, .editor-styles-wrapper ul.wp-block-categories__list li, .editor-styles-wrapper .wp-block-latest-comments time, .editor-styles-wrapper .wp-block-latest-posts time', 'color', $secondary );
}
// Header Footer Background Color.
if ( $header_footer_background && $header_footer_background !== $header_footer_background_default ) {
twentytwenty_generate_css( '.editor-styles-wrapper .wp-block-pullquote::before', 'background-color', $header_footer_background );
}
} elseif ( 'classic-editor' === $type ) {
// Colors.
// Accent color.
if ( $accent && $accent !== $accent_default ) {
twentytwenty_generate_css( 'body#tinymce.wp-editor.content a, body#tinymce.wp-editor.content a:focus, body#tinymce.wp-editor.content a:hover', 'color', $accent );
twentytwenty_generate_css( 'body#tinymce.wp-editor.content blockquote, body#tinymce.wp-editor.content .wp-block-quote', 'border-color', $accent, '', ' !important' );
twentytwenty_generate_css( 'body#tinymce.wp-editor.content button, body#tinymce.wp-editor.content .faux-button, body#tinymce.wp-editor.content .wp-block-button__link, body#tinymce.wp-editor.content .wp-block-file__button, body#tinymce.wp-editor.content input[type=\'button\'], body#tinymce.wp-editor.content input[type=\'reset\'], body#tinymce.wp-editor.content input[type=\'submit\']', 'background-color', $accent );
}
// Background color.
if ( $background && $background !== $background_default ) {
twentytwenty_generate_css( 'body#tinymce.wp-editor.content', 'background-color', '#' . $background );
}
// Text color.
if ( $body && $body !== $body_default ) {
twentytwenty_generate_css( 'body#tinymce.wp-editor.content', 'color', $body );
}
// Secondary color.
if ( $secondary && $secondary !== $secondary_default ) {
twentytwenty_generate_css( 'body#tinymce.wp-editor.content hr:not(.is-style-dots), body#tinymce.wp-editor.content cite, body#tinymce.wp-editor.content figcaption, body#tinymce.wp-editor.content .wp-caption-text, body#tinymce.wp-editor.content .wp-caption-dd, body#tinymce.wp-editor.content .gallery-caption', 'color', $secondary );
}
// Borders color.
if ( $borders && $borders !== $borders_default ) {
twentytwenty_generate_css( 'body#tinymce.wp-editor.content pre, body#tinymce.wp-editor.content hr, body#tinymce.wp-editor.content fieldset,body#tinymce.wp-editor.content input, body#tinymce.wp-editor.content textarea', 'border-color', $borders );
}
}
// Return the results.
return ob_get_clean();
}
}

View File

@ -0,0 +1,217 @@
<?php
/**
* Twenty Twenty Starter Content
*
* @link https://make.wordpress.org/core/2016/11/30/starter-content-for-themes-in-4-7/
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
/**
* Function to return the array of starter content for the theme.
*
* Passes it through the `twentytwenty_starter_content` filter before returning.
*
* @since Twenty Twenty 1.0
* @return array a filtered array of args for the starter_content.
*/
function twentytwenty_get_starter_content() {
// Define and register starter content to showcase the theme on new sites.
$starter_content = array(
'widgets' => array(
// Place one core-defined widgets in the first footer widget area.
'sidebar-1' => array(
'text_about',
),
// Place one core-defined widgets in the second footer widget area.
'sidebar-2' => array(
'text_business_info',
),
),
// Create the custom image attachments used as post thumbnails for pages.
'attachments' => array(
'image-opening' => array(
'post_title' => _x( 'The New UMoMA Opens its Doors', 'Theme starter content', 'twentytwenty' ),
'file' => 'assets/images/2020-landscape-1.png', // URL relative to the template directory.
),
),
// Specify the core-defined pages to create and add custom thumbnails to some of them.
'posts' => array(
'front' => array(
'post_type' => 'page',
'post_title' => __( 'The New UMoMA Opens its Doors', 'twentytwenty' ),
// Use the above featured image with the predefined about page.
'thumbnail' => '{{image-opening}}',
'post_content' => join(
'',
array(
'<!-- wp:group {"align":"wide"} -->',
'<div class="wp-block-group alignwide"><div class="wp-block-group__inner-container"><!-- wp:heading {"align":"center"} -->',
'<h2 class="has-text-align-center">' . __( 'The premier destination for modern art in Northern Sweden. Open from 10 AM to 6 PM every day during the summer months.', 'twentytwenty' ) . '</h2>',
'<!-- /wp:heading --></div></div>',
'<!-- /wp:group -->',
'<!-- wp:columns {"align":"wide"} -->',
'<div class="wp-block-columns alignwide"><!-- wp:column -->',
'<div class="wp-block-column"><!-- wp:group -->',
'<div class="wp-block-group"><div class="wp-block-group__inner-container">',
'<!-- wp:image {"align":"full","id":37,"sizeSlug":"full"} -->',
'<figure class="wp-block-image alignfull size-full"><img src="' . get_theme_file_uri() . '/assets/images/2020-three-quarters-1.png" alt="" class="wp-image-37"/></figure>',
'<!-- /wp:image -->',
'<!-- wp:heading {"level":3} -->',
'<h3>' . __( 'Works and Days', 'twentytwenty' ) . '</h3>',
'<!-- /wp:heading -->',
'<!-- wp:paragraph -->',
'<p>' . __( 'August 1 -- December 1', 'twentytwenty' ) . '</p>',
'<!-- /wp:paragraph -->',
'<!-- wp:button {"className":"is-style-outline"} -->',
'<div class="wp-block-button is-style-outline"><a class="wp-block-button__link" href="https://make.wordpress.org/core/2019/09/27/block-editor-theme-related-updates-in-wordpress-5-3/">' . __( 'Read More', 'twentytwenty' ) . '</a></div>',
'<!-- /wp:button --></div></div>',
'<!-- /wp:group -->',
'<!-- wp:group -->',
'<div class="wp-block-group"><div class="wp-block-group__inner-container">',
'<!-- wp:image {"align":"full","id":37,"sizeSlug":"full"} -->',
'<figure class="wp-block-image alignfull size-full"><img src="' . get_theme_file_uri() . '/assets/images/2020-three-quarters-3.png" alt="" class="wp-image-37"/></figure>',
'<!-- /wp:image -->',
'<!-- wp:heading {"level":3} -->',
'<h3>' . __( 'Theatre of Operations', 'twentytwenty' ) . '</h3>',
'<!-- /wp:heading -->',
'<!-- wp:paragraph -->',
'<p>' . __( 'October 1 -- December 1', 'twentytwenty' ) . '</p>',
'<!-- /wp:paragraph -->',
'<!-- wp:button {"className":"is-style-outline"} -->',
'<div class="wp-block-button is-style-outline"><a class="wp-block-button__link" href="https://make.wordpress.org/core/2019/09/27/block-editor-theme-related-updates-in-wordpress-5-3/">' . __( 'Read More', 'twentytwenty' ) . '</a></div>',
'<!-- /wp:button --></div></div>',
'<!-- /wp:group --></div>',
'<!-- /wp:column -->',
'<!-- wp:column -->',
'<div class="wp-block-column"><!-- wp:group -->',
'<div class="wp-block-group"><div class="wp-block-group__inner-container">',
'<!-- wp:image {"align":"full","id":37,"sizeSlug":"full"} -->',
'<figure class="wp-block-image alignfull size-full"><img src="' . get_theme_file_uri() . '/assets/images/2020-three-quarters-2.png" alt="" class="wp-image-37"/></figure>',
'<!-- /wp:image -->',
'<!-- wp:heading {"level":3} -->',
'<h3>' . __( 'The Life I Deserve', 'twentytwenty' ) . '</h3>',
'<!-- /wp:heading -->',
'<!-- wp:paragraph -->',
'<p>' . __( 'August 1 -- December 1', 'twentytwenty' ) . '</p>',
'<!-- /wp:paragraph -->',
'<!-- wp:button {"className":"is-style-outline"} -->',
'<div class="wp-block-button is-style-outline"><a class="wp-block-button__link" href="https://make.wordpress.org/core/2019/09/27/block-editor-theme-related-updates-in-wordpress-5-3/">' . __( 'Read More', 'twentytwenty' ) . '</a></div>',
'<!-- /wp:button --></div></div>',
'<!-- /wp:group -->',
'<!-- wp:group -->',
'<div class="wp-block-group"><div class="wp-block-group__inner-container">',
'<!-- wp:image {"align":"full","id":37,"sizeSlug":"full"} -->',
'<figure class="wp-block-image alignfull size-full"><img src="' . get_theme_file_uri() . '/assets/images/2020-three-quarters-4.png" alt="" class="wp-image-37"/></figure>',
'<!-- /wp:image -->',
'<!-- wp:heading {"level":3} -->',
'<h3>' . __( 'From Signac to Matisse', 'twentytwenty' ) . '</h3>',
'<!-- /wp:heading -->',
'<!-- wp:paragraph -->',
'<p>' . __( 'October 1 -- December 1', 'twentytwenty' ) . '</p>',
'<!-- /wp:paragraph -->',
'<!-- wp:button {"className":"is-style-outline"} -->',
'<div class="wp-block-button is-style-outline"><a class="wp-block-button__link" href="https://make.wordpress.org/core/2019/09/27/block-editor-theme-related-updates-in-wordpress-5-3/">' . __( 'Read More', 'twentytwenty' ) . '</a></div>',
'<!-- /wp:button --></div></div>',
'<!-- /wp:group --></div>',
'<!-- /wp:column --></div>',
'<!-- /wp:columns -->',
'<!-- wp:image {"align":"full","id":37,"sizeSlug":"full"} -->',
'<figure class="wp-block-image alignfull size-full"><img src="' . get_theme_file_uri() . '/assets/images/2020-landscape-2.png" alt="" class="wp-image-37"/></figure>',
'<!-- /wp:image -->',
'<!-- wp:group {"align":"wide"} -->',
'<div class="wp-block-group alignwide"><div class="wp-block-group__inner-container"><!-- wp:heading {"align":"center","textColor":"accent"} -->',
'<h2 class="has-accent-color has-text-align-center">' . __( '&#8220;Cyborgs, as the philosopher Donna Haraway established, are not reverent. They do not remember the cosmos.&#8221;', 'twentytwenty' ) . '</h2>',
'<!-- /wp:heading --></div></div>',
'<!-- /wp:group -->',
'<!-- wp:paragraph {"dropCap":true} -->',
'<p class="has-drop-cap">' . __( 'With seven floors of striking architecture, UMoMA shows exhibitions of international contemporary art, sometimes along with art historical retrospectives. Existential, political and philosophical issues are intrinsic to our programme. As visitor you are invited to guided tours artist talks, lectures, film screenings and other events with free admission', 'twentytwenty' ) . '</p>',
'<!-- /wp:paragraph -->',
'<!-- wp:paragraph -->',
'<p>' . __( 'The exhibitions are produced by UMoMA in collaboration with artists and museums around the world and they often attract international attention. UMoMA has received a Special Commendation from the European Museum of the Year, and was among the top candidates for the Swedish Museum of the Year Award as well as for the Council of Europe Museum Prize.', 'twentytwenty' ) . '</p>',
'<!-- /wp:paragraph -->',
'<!-- wp:paragraph -->',
'<p></p>',
'<!-- /wp:paragraph -->',
'<!-- wp:group {"customBackgroundColor":"#ffffff","align":"wide"} -->',
'<div class="wp-block-group alignwide has-background" style="background-color:#ffffff"><div class="wp-block-group__inner-container"><!-- wp:group -->',
'<div class="wp-block-group"><div class="wp-block-group__inner-container"><!-- wp:heading {"align":"center"} -->',
'<h2 class="has-text-align-center">' . __( 'Become a Member and Get Exclusive Offers!', 'twentytwenty' ) . '</h2>',
'<!-- /wp:heading -->',
'<!-- wp:paragraph {"align":"center"} -->',
'<p class="has-text-align-center">' . __( 'Members get access to exclusive exhibits and sales. Our memberships cost $99.99 and are billed annually.', 'twentytwenty' ) . '</p>',
'<!-- /wp:paragraph -->',
'<!-- wp:button {"align":"center"} -->',
'<div class="wp-block-button aligncenter"><a class="wp-block-button__link" href="https://make.wordpress.org/core/2019/09/27/block-editor-theme-related-updates-in-wordpress-5-3/">' . __( 'Join the Club', 'twentytwenty' ) . '</a></div>',
'<!-- /wp:button --></div></div>',
'<!-- /wp:group --></div></div>',
'<!-- /wp:group -->',
'<!-- wp:gallery {"ids":[39,38],"align":"wide"} -->',
'<figure class="wp-block-gallery alignwide columns-2 is-cropped"><ul class="blocks-gallery-grid"><li class="blocks-gallery-item"><figure><img src="' . get_theme_file_uri() . '/assets/images/2020-square-2.png" alt="" data-id="39" data-full-url="' . get_theme_file_uri() . '/assets/images/2020-square-2.png" data-link="assets/images/2020-square-2/" class="wp-image-39"/></figure></li><li class="blocks-gallery-item"><figure><img src="' . get_theme_file_uri() . '/assets/images/2020-square-1.png" alt="" data-id="38" data-full-url="' . get_theme_file_uri() . '/assets/images/2020-square-1.png" data-link="' . get_theme_file_uri() . '/assets/images/2020-square-1/" class="wp-image-38"/></figure></li></ul></figure>',
'<!-- /wp:gallery -->',
)
),
),
'about',
'contact',
'blog',
),
// Default to a static front page and assign the front and posts pages.
'options' => array(
'show_on_front' => 'page',
'page_on_front' => '{{front}}',
'page_for_posts' => '{{blog}}',
),
// Set up nav menus for each of the two areas registered in the theme.
'nav_menus' => array(
// Assign a menu to the "primary" location.
'primary' => array(
'name' => __( 'Primary', 'twentytwenty' ),
'items' => array(
'link_home', // Note that the core "home" page is actually a link in case a static front page is not used.
'page_about',
'page_blog',
'page_contact',
),
),
// This replicates primary just to demonstrate the expanded menu.
'expanded' => array(
'name' => __( 'Primary', 'twentytwenty' ),
'items' => array(
'link_home', // Note that the core "home" page is actually a link in case a static front page is not used.
'page_about',
'page_blog',
'page_contact',
),
),
// Assign a menu to the "social" location.
'social' => array(
'name' => __( 'Social Links Menu', 'twentytwenty' ),
'items' => array(
'link_yelp',
'link_facebook',
'link_twitter',
'link_instagram',
'link_email',
),
),
),
);
/**
* Filters Twenty Twenty array of starter content.
*
* @since Twenty Twenty 1.0
*
* @param array $starter_content Array of starter content.
*/
return apply_filters( 'twentytwenty_starter_content', $starter_content );
}

View File

@ -0,0 +1,70 @@
<?php
/**
* Twenty Twenty SVG Icon helper functions
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
if ( ! function_exists( 'twentytwenty_the_theme_svg' ) ) {
/**
* Output and Get Theme SVG.
* Output and get the SVG markup for an icon in the TwentyTwenty_SVG_Icons class.
*
* @param string $svg_name The name of the icon.
* @param string $group The group the icon belongs to.
* @param string $color Color code.
*/
function twentytwenty_the_theme_svg( $svg_name, $group = 'ui', $color = '' ) {
echo twentytwenty_get_theme_svg( $svg_name, $group, $color ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in twentytwenty_get_theme_svg().
}
}
if ( ! function_exists( 'twentytwenty_get_theme_svg' ) ) {
/**
* Get information about the SVG icon.
*
* @param string $svg_name The name of the icon.
* @param string $group The group the icon belongs to.
* @param string $color Color code.
*/
function twentytwenty_get_theme_svg( $svg_name, $group = 'ui', $color = '' ) {
// Make sure that only our allowed tags and attributes are included.
$svg = wp_kses(
TwentyTwenty_SVG_Icons::get_svg( $svg_name, $group, $color ),
array(
'svg' => array(
'class' => true,
'xmlns' => true,
'width' => true,
'height' => true,
'viewbox' => true,
'aria-hidden' => true,
'role' => true,
'focusable' => true,
),
'path' => array(
'fill' => true,
'fill-rule' => true,
'd' => true,
'transform' => true,
),
'polygon' => array(
'fill' => true,
'fill-rule' => true,
'points' => true,
'transform' => true,
'focusable' => true,
),
)
);
if ( ! $svg ) {
return false;
}
return $svg;
}
}

View File

@ -0,0 +1,790 @@
<?php
/**
* Custom template tags for this theme.
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
/**
* Table of Contents:
* Logo & Description
* Comments
* Post Meta
* Menus
* Classes
* Archives
* Miscellaneous
*/
/**
* Logo & Description
*/
/**
* Displays the site logo, either text or image.
*
* @param array $args Arguments for displaying the site logo either as an image or text.
* @param boolean $echo Echo or return the HTML.
*
* @return string $html Compiled HTML based on our arguments.
*/
function twentytwenty_site_logo( $args = array(), $echo = true ) {
$logo = get_custom_logo();
$site_title = get_bloginfo( 'name' );
$contents = '';
$classname = '';
$defaults = array(
'logo' => '%1$s<span class="screen-reader-text">%2$s</span>',
'logo_class' => 'site-logo',
'title' => '<a href="%1$s">%2$s</a>',
'title_class' => 'site-title',
'home_wrap' => '<h1 class="%1$s">%2$s</h1>',
'single_wrap' => '<div class="%1$s faux-heading">%2$s</div>',
'condition' => ( is_front_page() || is_home() ) && ! is_page(),
);
$args = wp_parse_args( $args, $defaults );
/**
* Filters the arguments for `twentytwenty_site_logo()`.
*
* @param array $args Parsed arguments.
* @param array $defaults Function's default arguments.
*/
$args = apply_filters( 'twentytwenty_site_logo_args', $args, $defaults );
if ( has_custom_logo() ) {
$contents = sprintf( $args['logo'], $logo, esc_html( $site_title ) );
$classname = $args['logo_class'];
} else {
$contents = sprintf( $args['title'], esc_url( get_home_url( null, '/' ) ), esc_html( $site_title ) );
$classname = $args['title_class'];
}
$wrap = $args['condition'] ? 'home_wrap' : 'single_wrap';
$html = sprintf( $args[ $wrap ], $classname, $contents );
/**
* Filters the arguments for `twentytwenty_site_logo()`.
*
* @param string $html Compiled html based on our arguments.
* @param array $args Parsed arguments.
* @param string $classname Class name based on current view, home or single.
* @param string $contents HTML for site title or logo.
*/
$html = apply_filters( 'twentytwenty_site_logo', $html, $args, $classname, $contents );
if ( ! $echo ) {
return $html;
}
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
* Displays the site description.
*
* @param boolean $echo Echo or return the html.
*
* @return string $html The HTML to display.
*/
function twentytwenty_site_description( $echo = true ) {
$description = get_bloginfo( 'description' );
if ( ! $description ) {
return;
}
$wrapper = '<div class="site-description">%s</div><!-- .site-description -->';
$html = sprintf( $wrapper, esc_html( $description ) );
/**
* Filters the html for the site description.
*
* @since Twenty Twenty 1.0
*
* @param string $html The HTML to display.
* @param string $description Site description via `bloginfo()`.
* @param string $wrapper The format used in case you want to reuse it in a `sprintf()`.
*/
$html = apply_filters( 'twentytwenty_site_description', $html, $description, $wrapper );
if ( ! $echo ) {
return $html;
}
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
* Comments
*/
/**
* Check if the specified comment is written by the author of the post commented on.
*
* @param object $comment Comment data.
*
* @return bool
*/
function twentytwenty_is_comment_by_post_author( $comment = null ) {
if ( is_object( $comment ) && $comment->user_id > 0 ) {
$user = get_userdata( $comment->user_id );
$post = get_post( $comment->comment_post_ID );
if ( ! empty( $user ) && ! empty( $post ) ) {
return $comment->user_id === $post->post_author;
}
}
return false;
}
/**
* Filter comment reply link to not JS scroll.
* Filter the comment reply link to add a class indicating it should not use JS slow-scroll, as it
* makes it scroll to the wrong position on the page.
*
* @param string $link Link to the top of the page.
*
* @return string $link Link to the top of the page.
*/
function twentytwenty_filter_comment_reply_link( $link ) {
$link = str_replace( 'class=\'', 'class=\'do-not-scroll ', $link );
return $link;
}
add_filter( 'comment_reply_link', 'twentytwenty_filter_comment_reply_link' );
/**
* Post Meta
*/
/**
* Get and Output Post Meta.
* If it's a single post, output the post meta values specified in the Customizer settings.
*
* @param int $post_id The ID of the post for which the post meta should be output.
* @param string $location Which post meta location to output single or preview.
*/
function twentytwenty_the_post_meta( $post_id = null, $location = 'single-top' ) {
echo twentytwenty_get_post_meta( $post_id, $location ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in twentytwenty_get_post_meta().
}
/**
* Filters the edit post link to add an icon and use the post meta structure.
*
* @param string $link Anchor tag for the edit link.
* @param int $post_id Post ID.
* @param string $text Anchor text.
*/
function twentytwenty_edit_post_link( $link, $post_id, $text ) {
if ( is_admin() ) {
return $link;
}
$edit_url = get_edit_post_link( $post_id );
if ( ! $edit_url ) {
return;
}
$text = sprintf(
wp_kses(
/* translators: %s: Post title. Only visible to screen readers. */
__( 'Edit <span class="screen-reader-text">%s</span>', 'twentytwenty' ),
array(
'span' => array(
'class' => array(),
),
)
),
get_the_title( $post_id )
);
return '<div class="post-meta-wrapper post-meta-edit-link-wrapper"><ul class="post-meta"><li class="post-edit meta-wrapper"><span class="meta-icon">' . twentytwenty_get_theme_svg( 'edit' ) . '</span><span class="meta-text"><a href="' . esc_url( $edit_url ) . '">' . $text . '</a></span></li></ul><!-- .post-meta --></div><!-- .post-meta-wrapper -->';
}
add_filter( 'edit_post_link', 'twentytwenty_edit_post_link', 10, 3 );
/**
* Get the post meta.
*
* @param int $post_id The ID of the post.
* @param string $location The location where the meta is shown.
*/
function twentytwenty_get_post_meta( $post_id = null, $location = 'single-top' ) {
// Require post ID.
if ( ! $post_id ) {
return;
}
/**
* Filters post types array
*
* This filter can be used to hide post meta information of post, page or custom post type registerd by child themes or plugins
*
* @since Twenty Twenty 1.0
*
* @param array Array of post types
*/
$disallowed_post_types = apply_filters( 'twentytwenty_disallowed_post_types_for_meta_output', array( 'page' ) );
// Check whether the post type is allowed to output post meta.
if ( in_array( get_post_type( $post_id ), $disallowed_post_types, true ) ) {
return;
}
$post_meta_wrapper_classes = '';
$post_meta_classes = '';
// Get the post meta settings for the location specified.
if ( 'single-top' === $location ) {
/**
* Filters post meta info visibility
*
* Use this filter to hide post meta information like Author, Post date, Comments, Is sticky status
*
* @since Twenty Twenty 1.0
*
* @param array $args {
* @type string 'author'
* @type string 'post-date'
* @type string 'comments'
* @type string 'sticky'
* }
*/
$post_meta = apply_filters(
'twentytwenty_post_meta_location_single_top',
array(
'author',
'post-date',
'comments',
'sticky',
)
);
$post_meta_wrapper_classes = ' post-meta-single post-meta-single-top';
} elseif ( 'single-bottom' === $location ) {
/**
* Filters post tags visibility
*
* Use this filter to hide post tags
*
* @since Twenty Twenty 1.0
*
* @param array $args {
* @type string 'tags'
* }
*/
$post_meta = apply_filters(
'twentytwenty_post_meta_location_single_bottom',
array(
'tags',
)
);
$post_meta_wrapper_classes = ' post-meta-single post-meta-single-bottom';
}
// If the post meta setting has the value 'empty', it's explicitly empty and the default post meta shouldn't be output.
if ( $post_meta && ! in_array( 'empty', $post_meta, true ) ) {
// Make sure we don't output an empty container.
$has_meta = false;
global $post;
$the_post = get_post( $post_id );
setup_postdata( $the_post );
ob_start();
?>
<div class="post-meta-wrapper<?php echo esc_attr( $post_meta_wrapper_classes ); ?>">
<ul class="post-meta<?php echo esc_attr( $post_meta_classes ); ?>">
<?php
/**
* Fires before post meta html display.
*
* Allow output of additional post meta info to be added by child themes and plugins.
*
* @since Twenty Twenty 1.0
* @since Twenty Twenty 1.1 Added the `$post_meta` and `$location` parameters.
*
* @param int $post_id Post ID.
* @param array $post_meta An array of post meta information.
* @param string $location The location where the meta is shown.
* Accepts 'single-top' or 'single-bottom'.
*/
do_action( 'twentytwenty_start_of_post_meta_list', $post_id, $post_meta, $location );
// Author.
if ( in_array( 'author', $post_meta, true ) ) {
$has_meta = true;
?>
<li class="post-author meta-wrapper">
<span class="meta-icon">
<span class="screen-reader-text"><?php _e( 'Post author', 'twentytwenty' ); ?></span>
<?php twentytwenty_the_theme_svg( 'user' ); ?>
</span>
<span class="meta-text">
<?php
printf(
/* translators: %s: Author name. */
__( 'By %s', 'twentytwenty' ),
'<a href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author_meta( 'display_name' ) ) . '</a>'
);
?>
</span>
</li>
<?php
}
// Post date.
if ( in_array( 'post-date', $post_meta, true ) ) {
$has_meta = true;
?>
<li class="post-date meta-wrapper">
<span class="meta-icon">
<span class="screen-reader-text"><?php _e( 'Post date', 'twentytwenty' ); ?></span>
<?php twentytwenty_the_theme_svg( 'calendar' ); ?>
</span>
<span class="meta-text">
<a href="<?php the_permalink(); ?>"><?php the_time( get_option( 'date_format' ) ); ?></a>
</span>
</li>
<?php
}
// Categories.
if ( in_array( 'categories', $post_meta, true ) && has_category() ) {
$has_meta = true;
?>
<li class="post-categories meta-wrapper">
<span class="meta-icon">
<span class="screen-reader-text"><?php _e( 'Categories', 'twentytwenty' ); ?></span>
<?php twentytwenty_the_theme_svg( 'folder' ); ?>
</span>
<span class="meta-text">
<?php _ex( 'In', 'A string that is output before one or more categories', 'twentytwenty' ); ?> <?php the_category( ', ' ); ?>
</span>
</li>
<?php
}
// Tags.
if ( in_array( 'tags', $post_meta, true ) && has_tag() ) {
$has_meta = true;
?>
<li class="post-tags meta-wrapper">
<span class="meta-icon">
<span class="screen-reader-text"><?php _e( 'Tags', 'twentytwenty' ); ?></span>
<?php twentytwenty_the_theme_svg( 'tag' ); ?>
</span>
<span class="meta-text">
<?php the_tags( '', ', ', '' ); ?>
</span>
</li>
<?php
}
// Comments link.
if ( in_array( 'comments', $post_meta, true ) && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
$has_meta = true;
?>
<li class="post-comment-link meta-wrapper">
<span class="meta-icon">
<?php twentytwenty_the_theme_svg( 'comment' ); ?>
</span>
<span class="meta-text">
<?php comments_popup_link(); ?>
</span>
</li>
<?php
}
// Sticky.
if ( in_array( 'sticky', $post_meta, true ) && is_sticky() ) {
$has_meta = true;
?>
<li class="post-sticky meta-wrapper">
<span class="meta-icon">
<?php twentytwenty_the_theme_svg( 'bookmark' ); ?>
</span>
<span class="meta-text">
<?php _e( 'Sticky post', 'twentytwenty' ); ?>
</span>
</li>
<?php
}
/**
* Fires after post meta html display.
*
* Allow output of additional post meta info to be added by child themes and plugins.
*
* @since Twenty Twenty 1.0
* @since Twenty Twenty 1.1 Added the `$post_meta` and `$location` parameters.
*
* @param int $post_id Post ID.
* @param array $post_meta An array of post meta information.
* @param string $location The location where the meta is shown.
* Accepts 'single-top' or 'single-bottom'.
*/
do_action( 'twentytwenty_end_of_post_meta_list', $post_id, $post_meta, $location );
?>
</ul><!-- .post-meta -->
</div><!-- .post-meta-wrapper -->
<?php
wp_reset_postdata();
$meta_output = ob_get_clean();
// If there is meta to output, return it.
if ( $has_meta && $meta_output ) {
return $meta_output;
}
}
}
/**
* Menus
*/
/**
* Filter Classes of wp_list_pages items to match menu items.
* Filter the class applied to wp_list_pages() items with children to match the menu class, to simplify.
* styling of sub levels in the fallback. Only applied if the match_menu_classes argument is set.
*
* @param array $css_class CSS Class names.
* @param string $item Comment.
* @param int $depth Depth of the current comment.
* @param array $args An array of arguments.
* @param string $current_page Whether or not the item is the current item.
*
* @return array $css_class CSS Class names.
*/
function twentytwenty_filter_wp_list_pages_item_classes( $css_class, $item, $depth, $args, $current_page ) {
// Only apply to wp_list_pages() calls with match_menu_classes set to true.
$match_menu_classes = isset( $args['match_menu_classes'] );
if ( ! $match_menu_classes ) {
return $css_class;
}
// Add current menu item class.
if ( in_array( 'current_page_item', $css_class, true ) ) {
$css_class[] = 'current-menu-item';
}
// Add menu item has children class.
if ( in_array( 'page_item_has_children', $css_class, true ) ) {
$css_class[] = 'menu-item-has-children';
}
return $css_class;
}
add_filter( 'page_css_class', 'twentytwenty_filter_wp_list_pages_item_classes', 10, 5 );
/**
* Add a Sub Nav Toggle to the Expanded Menu and Mobile Menu.
*
* @param stdClass $args An array of arguments.
* @param string $item Menu item.
* @param int $depth Depth of the current menu item.
*
* @return stdClass $args An object of wp_nav_menu() arguments.
*/
function twentytwenty_add_sub_toggles_to_main_menu( $args, $item, $depth ) {
// Add sub menu toggles to the Expanded Menu with toggles.
if ( isset( $args->show_toggles ) && $args->show_toggles ) {
// Wrap the menu item link contents in a div, used for positioning.
$args->before = '<div class="ancestor-wrapper">';
$args->after = '';
// Add a toggle to items with children.
if ( in_array( 'menu-item-has-children', $item->classes, true ) ) {
$toggle_target_string = '.menu-modal .menu-item-' . $item->ID . ' > .sub-menu';
$toggle_duration = twentytwenty_toggle_duration();
// Add the sub menu toggle.
$args->after .= '<button class="toggle sub-menu-toggle fill-children-current-color" data-toggle-target="' . $toggle_target_string . '" data-toggle-type="slidetoggle" data-toggle-duration="' . absint( $toggle_duration ) . '" aria-expanded="false"><span class="screen-reader-text">' . __( 'Show sub menu', 'twentytwenty' ) . '</span>' . twentytwenty_get_theme_svg( 'chevron-down' ) . '</button>';
}
// Close the wrapper.
$args->after .= '</div><!-- .ancestor-wrapper -->';
// Add sub menu icons to the primary menu without toggles.
} elseif ( 'primary' === $args->theme_location ) {
if ( in_array( 'menu-item-has-children', $item->classes, true ) ) {
$args->after = '<span class="icon"></span>';
} else {
$args->after = '';
}
}
return $args;
}
add_filter( 'nav_menu_item_args', 'twentytwenty_add_sub_toggles_to_main_menu', 10, 3 );
/**
* Display SVG icons in social links menu.
*
* @param string $item_output The menu item output.
* @param WP_Post $item Menu item object.
* @param int $depth Depth of the menu.
* @param array $args wp_nav_menu() arguments.
* @return string $item_output The menu item output with social icon.
*/
function twentytwenty_nav_menu_social_icons( $item_output, $item, $depth, $args ) {
// Change SVG icon inside social links menu if there is supported URL.
if ( 'social' === $args->theme_location ) {
$svg = TwentyTwenty_SVG_Icons::get_social_link_svg( $item->url );
if ( empty( $svg ) ) {
$svg = twentytwenty_get_theme_svg( 'link' );
}
$item_output = str_replace( $args->link_after, '</span>' . $svg, $item_output );
}
return $item_output;
}
add_filter( 'walker_nav_menu_start_el', 'twentytwenty_nav_menu_social_icons', 10, 4 );
/**
* Classes
*/
/**
* Add No-JS Class.
* If we're missing JavaScript support, the HTML element will have a no-js class.
*/
function twentytwenty_no_js_class() {
?>
<script>document.documentElement.className = document.documentElement.className.replace( 'no-js', 'js' );</script>
<?php
}
add_action( 'wp_head', 'twentytwenty_no_js_class' );
/**
* Add conditional body classes.
*
* @param array $classes Classes added to the body tag.
*
* @return array $classes Classes added to the body tag.
*/
function twentytwenty_body_classes( $classes ) {
global $post;
$post_type = isset( $post ) ? $post->post_type : false;
// Check whether we're singular.
if ( is_singular() ) {
$classes[] = 'singular';
}
// Check whether the current page should have an overlay header.
if ( is_page_template( array( 'templates/template-cover.php' ) ) ) {
$classes[] = 'overlay-header';
}
// Check whether the current page has full-width content.
if ( is_page_template( array( 'templates/template-full-width.php' ) ) ) {
$classes[] = 'has-full-width-content';
}
// Check for enabled search.
if ( true === get_theme_mod( 'enable_header_search', true ) ) {
$classes[] = 'enable-search-modal';
}
// Check for post thumbnail.
if ( is_singular() && has_post_thumbnail() ) {
$classes[] = 'has-post-thumbnail';
} elseif ( is_singular() ) {
$classes[] = 'missing-post-thumbnail';
}
// Check whether we're in the customizer preview.
if ( is_customize_preview() ) {
$classes[] = 'customizer-preview';
}
// Check if posts have single pagination.
if ( is_single() && ( get_next_post() || get_previous_post() ) ) {
$classes[] = 'has-single-pagination';
} else {
$classes[] = 'has-no-pagination';
}
// Check if we're showing comments.
if ( $post && ( ( 'post' === $post_type || comments_open() || get_comments_number() ) && ! post_password_required() ) ) {
$classes[] = 'showing-comments';
} else {
$classes[] = 'not-showing-comments';
}
// Check if avatars are visible.
$classes[] = get_option( 'show_avatars' ) ? 'show-avatars' : 'hide-avatars';
// Slim page template class names (class = name - file suffix).
if ( is_page_template() ) {
$classes[] = basename( get_page_template_slug(), '.php' );
}
// Check for the elements output in the top part of the footer.
$has_footer_menu = has_nav_menu( 'footer' );
$has_social_menu = has_nav_menu( 'social' );
$has_sidebar_1 = is_active_sidebar( 'sidebar-1' );
$has_sidebar_2 = is_active_sidebar( 'sidebar-2' );
// Add a class indicating whether those elements are output.
if ( $has_footer_menu || $has_social_menu || $has_sidebar_1 || $has_sidebar_2 ) {
$classes[] = 'footer-top-visible';
} else {
$classes[] = 'footer-top-hidden';
}
// Get header/footer background color.
$header_footer_background = get_theme_mod( 'header_footer_background_color', '#ffffff' );
$header_footer_background = strtolower( '#' . ltrim( $header_footer_background, '#' ) );
// Get content background color.
$background_color = get_theme_mod( 'background_color', 'f5efe0' );
$background_color = strtolower( '#' . ltrim( $background_color, '#' ) );
// Add extra class if main background and header/footer background are the same color.
if ( $background_color === $header_footer_background ) {
$classes[] = 'reduced-spacing';
}
return $classes;
}
add_filter( 'body_class', 'twentytwenty_body_classes' );
/**
* Archives
*/
/**
* Filters the archive title and styles the word before the first colon.
*
* @param string $title Current archive title.
*
* @return string $title Current archive title.
*/
function twentytwenty_get_the_archive_title( $title ) {
$regex = apply_filters(
'twentytwenty_get_the_archive_title_regex',
array(
'pattern' => '/(\A[^\:]+\:)/',
'replacement' => '<span class="color-accent">$1</span>',
)
);
if ( empty( $regex ) ) {
return $title;
}
return preg_replace( $regex['pattern'], $regex['replacement'], $title );
}
add_filter( 'get_the_archive_title', 'twentytwenty_get_the_archive_title' );
/**
* Miscellaneous
*/
/**
* Toggle animation duration in milliseconds.
*
* @return integer Duration in milliseconds
*/
function twentytwenty_toggle_duration() {
/**
* Filters the animation duration/speed used usually for submenu toggles.
*
* @since Twenty Twenty 1.0
*
* @param integer $duration Duration in milliseconds.
*/
$duration = apply_filters( 'twentytwenty_toggle_duration', 250 );
return $duration;
}
/**
* Get unique ID.
*
* This is a PHP implementation of Underscore's uniqueId method. A static variable
* contains an integer that is incremented with each call. This number is returned
* with the optional prefix. As such the returned value is not universally unique,
* but it is unique across the life of the PHP process.
*
* @see wp_unique_id() Themes requiring WordPress 5.0.3 and greater should use this instead.
*
* @staticvar int $id_counter
*
* @param string $prefix Prefix for the returned ID.
* @return string Unique ID.
*/
function twentytwenty_unique_id( $prefix = '' ) {
static $id_counter = 0;
if ( function_exists( 'wp_unique_id' ) ) {
return wp_unique_id( $prefix );
}
return $prefix . (string) ++$id_counter;
}

View File

@ -0,0 +1,117 @@
<?php
/**
* The main template file
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
get_header();
?>
<main id="site-content" role="main">
<?php
$archive_title = '';
$archive_subtitle = '';
if ( is_search() ) {
global $wp_query;
$archive_title = sprintf(
'%1$s %2$s',
'<span class="color-accent">' . __( 'Search:', 'twentytwenty' ) . '</span>',
'&ldquo;' . get_search_query() . '&rdquo;'
);
if ( $wp_query->found_posts ) {
$archive_subtitle = sprintf(
/* translators: %s: Number of search results. */
_n(
'We found %s result for your search.',
'We found %s results for your search.',
$wp_query->found_posts,
'twentytwenty'
),
number_format_i18n( $wp_query->found_posts )
);
} else {
$archive_subtitle = __( 'We could not find any results for your search. You can give it another try through the search form below.', 'twentytwenty' );
}
} elseif ( ! is_home() ) {
$archive_title = get_the_archive_title();
$archive_subtitle = get_the_archive_description();
}
if ( $archive_title || $archive_subtitle ) {
?>
<header class="archive-header has-text-align-center header-footer-group">
<div class="archive-header-inner section-inner medium">
<?php if ( $archive_title ) { ?>
<h1 class="archive-title"><?php echo wp_kses_post( $archive_title ); ?></h1>
<?php } ?>
<?php if ( $archive_subtitle ) { ?>
<div class="archive-subtitle section-inner thin max-percentage intro-text"><?php echo wp_kses_post( wpautop( $archive_subtitle ) ); ?></div>
<?php } ?>
</div><!-- .archive-header-inner -->
</header><!-- .archive-header -->
<?php
}
if ( have_posts() ) {
$i = 0;
while ( have_posts() ) {
$i++;
if ( $i > 1 ) {
echo '<hr class="post-separator styled-separator is-style-wide section-inner" aria-hidden="true" />';
}
the_post();
get_template_part( 'template-parts/content', get_post_type() );
}
} elseif ( is_search() ) {
?>
<div class="no-search-results-form section-inner thin">
<?php
get_search_form(
array(
'label' => __( 'search again', 'twentytwenty' ),
)
);
?>
</div><!-- .no-search-results -->
<?php
}
?>
<?php get_template_part( 'template-parts/pagination' ); ?>
</main><!-- #site-content -->
<?php get_template_part( 'template-parts/footer-menus-widgets' ); ?>
<?php
get_footer();

13041
web/app/themes/Lamine__old/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,59 @@
{
"name": "twentytwenty",
"version": "1.0.0",
"description": "Default WP Theme",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
"keywords": [
"WordPress",
"Theme",
"TwentyTwenty"
],
"homepage": "https://github.com/wordpress/twentytwenty#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/wordpress/twentytwenty.git"
},
"bugs": {
"url": "https://github.com/wordpress/twentytwenty/issues"
},
"devDependencies": {
"@wordpress/browserslist-config": "^2.6.0",
"@wordpress/scripts": "^5.0.0",
"autoprefixer": "^9.6.1",
"concurrently": "^4.1.2",
"postcss-cli": "^6.1.3",
"rtlcss": "^2.4.0",
"stylelint-a11y": "^1.2.1"
},
"browserslist": [
"extends @wordpress/browserslist-config"
],
"rtlcssConfig": {
"options": {
"autoRename": false,
"autoRenameStrict": false,
"blacklist": {},
"clean": true,
"greedy": false,
"processUrls": false,
"stringMap": []
},
"plugins": [],
"map": false
},
"scripts": {
"build": "npm run build:vendor-prefixes && npm run build:rtl",
"build:rtl": "concurrently \"npm run build:rtl-style\" \"npm run build:rtl-esb\" \"npm run build:rtl-esc\"",
"build:rtl-style": "rtlcss style.css style-rtl.css",
"build:rtl-esb": "rtlcss assets/css/editor-style-block.css assets/css/editor-style-block-rtl.css",
"build:rtl-esc": "rtlcss assets/css/editor-style-classic.css assets/css/editor-style-classic-rtl.css",
"build:vendor-prefixes": "concurrently \"npm run build:vendor-prefixes-style\" \"npm run build:vendor-prefixes-esb\" \"npm run build:vendor-prefixes-esc\"",
"build:vendor-prefixes-style": "postcss -r --no-map style.css assets/css/editor-style-block.css assets/css/editor-style-classic.css",
"build:vendor-prefixes-esb": "postcss -r --no-map assets/css/editor-style-block.css ",
"build:vendor-prefixes-esc": "postcss -r --no-map assets/css/editor-style-classic.css",
"lint:css": "wp-scripts lint-style 'style.css' 'assets/**/*.css'",
"lint:js": "wp-scripts lint-js 'assets/**/*.js'",
"lint:pkg-json": "wp-scripts lint-pkg-json"
}
}

View File

@ -0,0 +1,165 @@
@charset "UTF-8";
/*
Theme Name: Twenty Twenty
Adding print support. The print styles are based on the the great work of
Andreas Hecht in https://www.jotform.com/blog/css-perfect-print-stylesheet-98272/.
*/
/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
# Margins
# Paddings
# Width
# Typography
# Page breaks
# Links
# Visibility
--------------------------------------------------------------*/
@media print {
/* Margins */
@page {
margin: 2cm;
}
.entry-header,
.site-footer {
margin: 0;
}
/* Paddings */
.posts {
padding: 0;
}
/* Width */
.entry-content,
.entry-content p,
.section-inner,
.section-inner.max-percentage,
.section-inner.medium,
.section-inner.small,
.section-inner.thin {
max-width: 100%;
width: 100%;
}
/* Fonts */
body {
background: #fff !important;
color: #000;
font: 13pt Georgia, "Times New Roman", Times, serif;
line-height: 1.3;
}
h1 {
font-size: 20pt;
}
h2,
h2.entry-title,
h3,
h4,
.has-normal-font-size,
.has-regular-font-size,
.has-large-font-size,
.comments-header {
font-size: 14pt;
margin-top: 1cm;
}
/* Page breaks */
a {
page-break-inside: avoid;
}
blockquote {
page-break-inside: avoid;
}
h1,
h2,
h3,
h4,
h5,
h6 {
page-break-after: avoid;
page-break-inside: avoid;
}
img {
page-break-inside: avoid;
page-break-after: avoid;
}
table,
pre {
page-break-inside: avoid;
}
ul,
ol,
dl {
page-break-before: avoid;
}
/* Links */
a:link,
a:visited,
a {
background: transparent;
font-weight: bold;
text-decoration: underline;
}
a {
page-break-inside: avoid;
}
a[href^="http"]:after {
content: " < " attr(href) "> ";
}
a:after > img {
content: "";
}
article a[href^="#"]:after {
content: "";
}
a:not(:local-link):after {
content: " < " attr(href) "> ";
}
/* Visibility */
#site-header,
.comment-form,
.comments-wrapper,
.comment .comment-metadata,
.footer-social-wrapper,
.footer-widgets-outer-wrapper,
.header-navigation-wrapper,
.pagination-wrapper,
.post-meta-wrapper.post-meta-single-bottom,
.post-separator,
.site-logo img {
display: none;
}
.entry-content .wp-block-button .wp-block-button__link,
.entry-content .wp-block-button .wp-block-file__button,
.entry-content .button {
background: none;
color: #000;
}
}

View File

@ -0,0 +1,103 @@
=== Twenty Twenty ===
Contributors: the WordPress team
Tested up to: 5.3
Stable tag: 1.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Default theme for 2020.
== Description ==
Our default theme for 2020 is designed to take full advantage of the
flexibility of the block editor. Organizations and businesses have the
ability to create dynamic landing pages with endless layouts using the
group and column blocks. The centered content column and fine-tuned
typography also makes it perfect for traditional blogs. Complete editor
styles give you a good idea of what your content will look like, even
before you publish. You can give your site a personal touch by changing
the background colors and the accent color in the Customizer. The colors of
all elements on your site are automatically calculated based on the colors
you pick, ensuring a high, accessible color contrast for your visitors.
== Changelog ==
= 1.2 =
* Released: March 31, 2020
https://wordpress.org/support/article/twenty-twenty-changelog/#Version_1.2
= 1.1 =
* Released: December 12, 2019
https://wordpress.org/support/article/twenty-twenty-changelog/#Version_1.1
= 1.0 =
* Released: November 12, 2019
Initial release
== Copyright ==
Twenty Twenty WordPress Theme, Copyright 2019-2020 WordPress.org
Twenty Twenty is distributed under the terms of the GNU GPL.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Twenty Twenty is derived from the Chaplin Theme, Copyright 2019 Anders Norén
Chaplin Theme is distributed under the terms of the GNU GPL version 2.0
Twenty Twenty bundles the following third-party resources:
Illustrations in screenshot.png by Tammie Lister
License: Creative Commons Zero (CC0), https://creativecommons.org/publicdomain/zero/1.0/
Inter Font
Copyright (c) 2016-2019 The Inter Project Authors (me@rsms.me)
License: SIL Open Font License, 1.1, https://opensource.org/licenses/OFL-1.1
Source: https://rsms.me/inter/
Bespoke Icons Created For Twenty Twenty
License: Creative Commons Zero (CC0), https://creativecommons.org/publicdomain/zero/1.0/
List of bespoke icons:
- Search icon
- Menu icon
Feather Icons
Copyright (c) 2013-2017 Cole Bemis
License: MIT License, https://opensource.org/licenses/MIT
Source: https://feathericons.com
Used for post meta icons, and the link icon in the social menu.
Social Icons
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Source: WordPress Social Link Block (See wp-includes\blocks\social-link.php)
Code from Twenty Nineteen
Copyright (c) 2018-2020 WordPress.org
License: GPLv2
Source: https://wordpress.org/themes/twentynineteen/
Included as part of the following classes and functions:
- TwentyTwenty_SVG_Icons
- twentytwenty_the_theme_svg()
- twentytwenty_get_theme_svg()
- twentytwenty_nav_menu_social_icons()
Code from Twenty Seventeen
Copyright (c) 2016-2020 WordPress.org
License: GPLv2
Source: https://wordpress.org/themes/twentyseventeen/
Included as part of the following classes and functions:
- twentytwenty_unique_id()
Underscores
https://underscores.me/, (C) 2012-2019 Automattic, Inc., [GPLv2 or later](https://www.gnu.org/licenses/gpl-2.0.html)

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View File

@ -0,0 +1,28 @@
<?php
/**
* The searchform.php template.
*
* Used any time that get_search_form() is called.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
/*
* Generate a unique ID for each form and a string containing an aria-label
* if one was passed to get_search_form() in the args array.
*/
$twentytwenty_unique_id = twentytwenty_unique_id( 'search-form-' );
$twentytwenty_aria_label = ! empty( $args['label'] ) ? 'aria-label="' . esc_attr( $args['label'] ) . '"' : '';
?>
<form role="search" <?php echo $twentytwenty_aria_label; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped above. ?> method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<label for="<?php echo esc_attr( $twentytwenty_unique_id ); ?>">
<span class="screen-reader-text"><?php _e( 'Search for:', 'twentytwenty' ); // phpcs:ignore: WordPress.Security.EscapeOutput.UnsafePrintingFunction -- core trusts translations ?></span>
<input type="search" id="<?php echo esc_attr( $twentytwenty_unique_id ); ?>" class="search-field" placeholder="<?php echo esc_attr_x( 'Search &hellip;', 'placeholder', 'twentytwenty' ); ?>" value="<?php echo get_search_query(); ?>" name="s" />
</label>
<input type="submit" class="search-submit" value="<?php echo esc_attr_x( 'Search', 'submit button', 'twentytwenty' ); ?>" />
</form>

View File

@ -0,0 +1,34 @@
<?php
/**
* The template for displaying single posts and pages.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
get_header();
?>
<main id="site-content" role="main">
<?php
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
get_template_part( 'template-parts/content', get_post_type() );
}
}
?>
</main><!-- #site-content -->
<?php get_template_part( 'template-parts/footer-menus-widgets' ); ?>
<?php get_footer(); ?>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,182 @@
<?php
/**
* Displays the content when the cover template is used.
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
?>
<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<?php
// On the cover page template, output the cover header.
$cover_header_style = '';
$cover_header_classes = '';
$color_overlay_style = '';
$color_overlay_classes = '';
$image_url = ! post_password_required() ? get_the_post_thumbnail_url( get_the_ID(), 'twentytwenty-fullscreen' ) : '';
if ( $image_url ) {
$cover_header_style = ' style="background-image: url( ' . esc_url( $image_url ) . ' );"';
$cover_header_classes = ' bg-image';
}
// Get the color used for the color overlay.
$color_overlay_color = get_theme_mod( 'cover_template_overlay_background_color' );
if ( $color_overlay_color ) {
$color_overlay_style = ' style="color: ' . esc_attr( $color_overlay_color ) . ';"';
} else {
$color_overlay_style = '';
}
// Get the fixed background attachment option.
if ( get_theme_mod( 'cover_template_fixed_background', true ) ) {
$cover_header_classes .= ' bg-attachment-fixed';
}
// Get the opacity of the color overlay.
$color_overlay_opacity = get_theme_mod( 'cover_template_overlay_opacity' );
$color_overlay_opacity = ( false === $color_overlay_opacity ) ? 80 : $color_overlay_opacity;
$color_overlay_classes .= ' opacity-' . $color_overlay_opacity;
?>
<div class="cover-header <?php echo $cover_header_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>"<?php echo $cover_header_style; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- We need to double check this, but for now, we want to pass PHPCS ;) ?>>
<div class="cover-header-inner-wrapper screen-height">
<div class="cover-header-inner">
<div class="cover-color-overlay color-accent<?php echo esc_attr( $color_overlay_classes ); ?>"<?php echo $color_overlay_style; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- We need to double check this, but for now, we want to pass PHPCS ;) ?>></div>
<header class="entry-header has-text-align-center">
<div class="entry-header-inner section-inner medium">
<?php
/**
* Allow child themes and plugins to filter the display of the categories in the article header.
*
* @since Twenty Twenty 1.0
*
* @param bool Whether to show the categories in article header, Default true.
*/
$show_categories = apply_filters( 'twentytwenty_show_categories_in_entry_header', true );
if ( true === $show_categories && has_category() ) {
?>
<div class="entry-categories">
<span class="screen-reader-text"><?php _e( 'Categories', 'twentytwenty' ); ?></span>
<div class="entry-categories-inner">
<?php the_category( ' ' ); ?>
</div><!-- .entry-categories-inner -->
</div><!-- .entry-categories -->
<?php
}
the_title( '<h1 class="entry-title">', '</h1>' );
if ( is_page() ) {
?>
<div class="to-the-content-wrapper">
<a href="#post-inner" class="to-the-content fill-children-current-color">
<?php twentytwenty_the_theme_svg( 'arrow-down' ); ?>
<div class="screen-reader-text"><?php _e( 'Scroll Down', 'twentytwenty' ); ?></div>
</a><!-- .to-the-content -->
</div><!-- .to-the-content-wrapper -->
<?php
} else {
$intro_text_width = '';
if ( is_singular() ) {
$intro_text_width = ' small';
} else {
$intro_text_width = ' thin';
}
if ( has_excerpt() ) {
?>
<div class="intro-text section-inner max-percentage<?php echo esc_attr( $intro_text_width ); ?>">
<?php the_excerpt(); ?>
</div>
<?php
}
twentytwenty_the_post_meta( get_the_ID(), 'single-top' );
}
?>
</div><!-- .entry-header-inner -->
</header><!-- .entry-header -->
</div><!-- .cover-header-inner -->
</div><!-- .cover-header-inner-wrapper -->
</div><!-- .cover-header -->
<div class="post-inner" id="post-inner">
<div class="entry-content">
<?php
the_content();
?>
</div><!-- .entry-content -->
<?php
wp_link_pages(
array(
'before' => '<nav class="post-nav-links bg-light-background" aria-label="' . esc_attr__( 'Page', 'twentytwenty' ) . '"><span class="label">' . __( 'Pages:', 'twentytwenty' ) . '</span>',
'after' => '</nav>',
'link_before' => '<span class="page-number">',
'link_after' => '</span>',
)
);
edit_post_link();
// Single bottom post meta.
twentytwenty_the_post_meta( get_the_ID(), 'single-bottom' );
if ( is_single() ) {
get_template_part( 'template-parts/entry-author-bio' );
}
?>
</div><!-- .post-inner -->
<?php
if ( is_single() ) {
get_template_part( 'template-parts/navigation' );
}
/**
* Output comments wrapper if it's a post, or if comments are open,
* or if there's a comment number and check for password.
* */
if ( ( is_single() || is_page() ) && ( comments_open() || get_comments_number() ) && ! post_password_required() ) {
?>
<div class="comments-wrapper section-inner">
<?php comments_template(); ?>
</div><!-- .comments-wrapper -->
<?php
}
?>
</article><!-- .post -->

View File

@ -0,0 +1,94 @@
<?php
/**
* The default template for displaying content
*
* Used for both singular and index.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
?>
<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<?php
get_template_part( 'template-parts/entry-header' );
if ( ! is_search() ) {
get_template_part( 'template-parts/featured-image' );
}
?>
<div class="post-inner <?php echo is_page_template( 'templates/template-full-width.php' ) ? '' : 'thin'; ?> ">
<div class="entry-content">
<?php
if ( is_search() || ! is_singular() && 'summary' === get_theme_mod( 'blog_content', 'full' ) ) {
the_excerpt();
} else {
the_content( __( 'Continue reading', 'twentytwenty' ) );
}
?>
</div><!-- .entry-content -->
</div><!-- .post-inner -->
<div class="section-inner">
<?php
wp_link_pages(
array(
'before' => '<nav class="post-nav-links bg-light-background" aria-label="' . esc_attr__( 'Page', 'twentytwenty' ) . '"><span class="label">' . __( 'Pages:', 'twentytwenty' ) . '</span>',
'after' => '</nav>',
'link_before' => '<span class="page-number">',
'link_after' => '</span>',
)
);
edit_post_link();
// Single bottom post meta.
twentytwenty_the_post_meta( get_the_ID(), 'single-bottom' );
if ( is_single() ) {
get_template_part( 'template-parts/entry-author-bio' );
}
?>
</div><!-- .section-inner -->
<?php
if ( is_single() ) {
get_template_part( 'template-parts/navigation' );
}
/**
* Output comments wrapper if it's a post, or if comments are open,
* or if there's a comment number and check for password.
* */
if ( ( is_single() || is_page() ) && ( comments_open() || get_comments_number() ) && ! post_password_required() ) {
?>
<div class="comments-wrapper section-inner">
<?php comments_template(); ?>
</div><!-- .comments-wrapper -->
<?php
}
?>
</article><!-- .post -->

View File

@ -0,0 +1,33 @@
<?php
/**
* The template for displaying Author info
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
if ( (bool) get_the_author_meta( 'description' ) && (bool) get_theme_mod( 'show_author_bio', true ) ) : ?>
<div class="author-bio">
<div class="author-title-wrapper">
<div class="author-avatar vcard">
<?php echo get_avatar( get_the_author_meta( 'ID' ), 160 ); ?>
</div>
<h2 class="author-title heading-size-4">
<?php
printf(
/* translators: %s: Author name. */
__( 'By %s', 'twentytwenty' ),
esc_html( get_the_author() )
);
?>
</h2>
</div><!-- .author-name -->
<div class="author-description">
<?php echo wp_kses_post( wpautop( get_the_author_meta( 'description' ) ) ); ?>
<a class="author-link" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
<?php _e( 'View Archive <span aria-hidden="true">&rarr;</span>', 'twentytwenty' ); ?>
</a>
</div><!-- .author-description -->
</div><!-- .author-bio -->
<?php endif; ?>

View File

@ -0,0 +1,75 @@
<?php
/**
* Displays the post header
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
$entry_header_classes = '';
if ( is_singular() ) {
$entry_header_classes .= ' header-footer-group';
}
?>
<header class="entry-header has-text-align-center<?php echo esc_attr( $entry_header_classes ); ?>">
<div class="entry-header-inner section-inner medium">
<?php
/**
* Allow child themes and plugins to filter the display of the categories in the entry header.
*
* @since Twenty Twenty 1.0
*
* @param bool Whether to show the categories in header, Default true.
*/
$show_categories = apply_filters( 'twentytwenty_show_categories_in_entry_header', true );
if ( true === $show_categories && has_category() ) {
?>
<div class="entry-categories">
<span class="screen-reader-text"><?php _e( 'Categories', 'twentytwenty' ); ?></span>
<div class="entry-categories-inner">
<?php the_category( ' ' ); ?>
</div><!-- .entry-categories-inner -->
</div><!-- .entry-categories -->
<?php
}
if ( is_singular() ) {
the_title( '<h1 class="entry-title">', '</h1>' );
} else {
the_title( '<h2 class="entry-title heading-size-1"><a href="' . esc_url( get_permalink() ) . '">', '</a></h2>' );
}
$intro_text_width = '';
if ( is_singular() ) {
$intro_text_width = ' small';
} else {
$intro_text_width = ' thin';
}
if ( has_excerpt() && is_singular() ) {
?>
<div class="intro-text section-inner max-percentage<?php echo $intro_text_width; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>">
<?php the_excerpt(); ?>
</div>
<?php
}
// Default to displaying the post meta.
twentytwenty_the_post_meta( get_the_ID(), 'single-top' );
?>
</div><!-- .entry-header-inner -->
</header><!-- .entry-header -->

View File

@ -0,0 +1,43 @@
<?php
/**
* Displays the featured image
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
if ( has_post_thumbnail() && ! post_password_required() ) {
$featured_media_inner_classes = '';
// Make the featured media thinner on archive pages.
if ( ! is_singular() ) {
$featured_media_inner_classes .= ' medium';
}
?>
<figure class="featured-media">
<div class="featured-media-inner section-inner<?php echo $featured_media_inner_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>">
<?php
the_post_thumbnail();
$caption = get_the_post_thumbnail_caption();
if ( $caption ) {
?>
<figcaption class="wp-caption-text"><?php echo esc_html( $caption ); ?></figcaption>
<?php
}
?>
</div><!-- .featured-media-inner -->
</figure><!-- .featured-media -->
<?php
}

View File

@ -0,0 +1,119 @@
<?php
/**
* Displays the menus and widgets at the end of the main element.
* Visually, this output is presented as part of the footer element.
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
$has_footer_menu = has_nav_menu( 'footer' );
$has_social_menu = has_nav_menu( 'social' );
$has_sidebar_1 = is_active_sidebar( 'sidebar-1' );
$has_sidebar_2 = is_active_sidebar( 'sidebar-2' );
// Only output the container if there are elements to display.
if ( $has_footer_menu || $has_social_menu || $has_sidebar_1 || $has_sidebar_2 ) {
?>
<div class="footer-nav-widgets-wrapper header-footer-group">
<div class="footer-inner section-inner">
<?php
$footer_top_classes = '';
$footer_top_classes .= $has_footer_menu ? ' has-footer-menu' : '';
$footer_top_classes .= $has_social_menu ? ' has-social-menu' : '';
if ( $has_footer_menu || $has_social_menu ) {
?>
<div class="footer-top<?php echo $footer_top_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>">
<?php if ( $has_footer_menu ) { ?>
<nav aria-label="<?php esc_attr_e( 'Footer', 'twentytwenty' ); ?>" role="navigation" class="footer-menu-wrapper">
<ul class="footer-menu reset-list-style">
<?php
wp_nav_menu(
array(
'container' => '',
'depth' => 1,
'items_wrap' => '%3$s',
'theme_location' => 'footer',
)
);
?>
</ul>
</nav><!-- .site-nav -->
<?php } ?>
<?php if ( $has_social_menu ) { ?>
<nav aria-label="<?php esc_attr_e( 'Social links', 'twentytwenty' ); ?>" class="footer-social-wrapper">
<ul class="social-menu footer-social reset-list-style social-icons fill-children-current-color">
<?php
wp_nav_menu(
array(
'theme_location' => 'social',
'container' => '',
'container_class' => '',
'items_wrap' => '%3$s',
'menu_id' => '',
'menu_class' => '',
'depth' => 1,
'link_before' => '<span class="screen-reader-text">',
'link_after' => '</span>',
'fallback_cb' => '',
)
);
?>
</ul><!-- .footer-social -->
</nav><!-- .footer-social-wrapper -->
<?php } ?>
</div><!-- .footer-top -->
<?php } ?>
<?php if ( $has_sidebar_1 || $has_sidebar_2 ) { ?>
<aside class="footer-widgets-outer-wrapper" role="complementary">
<div class="footer-widgets-wrapper">
<?php if ( $has_sidebar_1 ) { ?>
<div class="footer-widgets column-one grid-item">
<?php dynamic_sidebar( 'sidebar-1' ); ?>
</div>
<?php } ?>
<?php if ( $has_sidebar_2 ) { ?>
<div class="footer-widgets column-two grid-item">
<?php dynamic_sidebar( 'sidebar-2' ); ?>
</div>
<?php } ?>
</div><!-- .footer-widgets-wrapper -->
</aside><!-- .footer-widgets-outer-wrapper -->
<?php } ?>
</div><!-- .footer-inner -->
</div><!-- .footer-nav-widgets-wrapper -->
<?php } ?>

View File

@ -0,0 +1,148 @@
<?php
/**
* Displays the menu icon and modal
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
?>
<div class="menu-modal cover-modal header-footer-group" data-modal-target-string=".menu-modal">
<div class="menu-modal-inner modal-inner">
<div class="menu-wrapper section-inner">
<div class="menu-top">
<button class="toggle close-nav-toggle fill-children-current-color" data-toggle-target=".menu-modal" data-toggle-body-class="showing-menu-modal" aria-expanded="false" data-set-focus=".menu-modal">
<span class="toggle-text"><?php _e( 'Close Menu', 'twentytwenty' ); ?></span>
<?php twentytwenty_the_theme_svg( 'cross' ); ?>
</button><!-- .nav-toggle -->
<?php
$mobile_menu_location = '';
// If the mobile menu location is not set, use the primary and expanded locations as fallbacks, in that order.
if ( has_nav_menu( 'mobile' ) ) {
$mobile_menu_location = 'mobile';
} elseif ( has_nav_menu( 'primary' ) ) {
$mobile_menu_location = 'primary';
} elseif ( has_nav_menu( 'expanded' ) ) {
$mobile_menu_location = 'expanded';
}
if ( has_nav_menu( 'expanded' ) ) {
$expanded_nav_classes = '';
if ( 'expanded' === $mobile_menu_location ) {
$expanded_nav_classes .= ' mobile-menu';
}
?>
<nav class="expanded-menu<?php echo esc_attr( $expanded_nav_classes ); ?>" aria-label="<?php esc_attr_e( 'Expanded', 'twentytwenty' ); ?>" role="navigation">
<ul class="modal-menu reset-list-style">
<?php
if ( has_nav_menu( 'expanded' ) ) {
wp_nav_menu(
array(
'container' => '',
'items_wrap' => '%3$s',
'show_toggles' => true,
'theme_location' => 'expanded',
)
);
}
?>
</ul>
</nav>
<?php
}
if ( 'expanded' !== $mobile_menu_location ) {
?>
<nav class="mobile-menu" aria-label="<?php esc_attr_e( 'Mobile', 'twentytwenty' ); ?>" role="navigation">
<ul class="modal-menu reset-list-style">
<?php
if ( $mobile_menu_location ) {
wp_nav_menu(
array(
'container' => '',
'items_wrap' => '%3$s',
'show_toggles' => true,
'theme_location' => $mobile_menu_location,
)
);
} else {
wp_list_pages(
array(
'match_menu_classes' => true,
'show_toggles' => true,
'title_li' => false,
'walker' => new TwentyTwenty_Walker_Page(),
)
);
}
?>
</ul>
</nav>
<?php
}
?>
</div><!-- .menu-top -->
<div class="menu-bottom">
<?php if ( has_nav_menu( 'social' ) ) { ?>
<nav aria-label="<?php esc_attr_e( 'Expanded Social links', 'twentytwenty' ); ?>" role="navigation">
<ul class="social-menu reset-list-style social-icons fill-children-current-color">
<?php
wp_nav_menu(
array(
'theme_location' => 'social',
'container' => '',
'container_class' => '',
'items_wrap' => '%3$s',
'menu_id' => '',
'menu_class' => '',
'depth' => 1,
'link_before' => '<span class="screen-reader-text">',
'link_after' => '</span>',
'fallback_cb' => '',
)
);
?>
</ul>
</nav><!-- .social-menu -->
<?php } ?>
</div><!-- .menu-bottom -->
</div><!-- .menu-wrapper -->
</div><!-- .menu-modal-inner -->
</div><!-- .menu-modal -->

View File

@ -0,0 +1,34 @@
<?php
/**
* Displays the search icon and modal
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
?>
<div class="search-modal cover-modal header-footer-group" data-modal-target-string=".search-modal">
<div class="search-modal-inner modal-inner">
<div class="section-inner">
<?php
get_search_form(
array(
'label' => __( 'Search for:', 'twentytwenty' ),
)
);
?>
<button class="toggle search-untoggle close-search-toggle fill-children-current-color" data-toggle-target=".search-modal" data-toggle-body-class="showing-search-modal" data-set-focus=".search-modal .search-field" aria-expanded="false">
<span class="screen-reader-text"><?php _e( 'Close search', 'twentytwenty' ); ?></span>
<?php twentytwenty_the_theme_svg( 'cross' ); ?>
</button><!-- .search-toggle -->
</div><!-- .section-inner -->
</div><!-- .search-modal-inner -->
</div><!-- .menu-modal -->

View File

@ -0,0 +1,61 @@
<?php
/**
* Displays the next and previous post navigation in single posts.
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
$next_post = get_next_post();
$prev_post = get_previous_post();
if ( $next_post || $prev_post ) {
$pagination_classes = '';
if ( ! $next_post ) {
$pagination_classes = ' only-one only-prev';
} elseif ( ! $prev_post ) {
$pagination_classes = ' only-one only-next';
}
?>
<nav class="pagination-single section-inner<?php echo esc_attr( $pagination_classes ); ?>" aria-label="<?php esc_attr_e( 'Post', 'twentytwenty' ); ?>" role="navigation">
<hr class="styled-separator is-style-wide" aria-hidden="true" />
<div class="pagination-single-inner">
<?php
if ( $prev_post ) {
?>
<a class="previous-post" href="<?php echo esc_url( get_permalink( $prev_post->ID ) ); ?>">
<span class="arrow" aria-hidden="true">&larr;</span>
<span class="title"><span class="title-inner"><?php echo wp_kses_post( get_the_title( $prev_post->ID ) ); ?></span></span>
</a>
<?php
}
if ( $next_post ) {
?>
<a class="next-post" href="<?php echo esc_url( get_permalink( $next_post->ID ) ); ?>">
<span class="arrow" aria-hidden="true">&rarr;</span>
<span class="title"><span class="title-inner"><?php echo wp_kses_post( get_the_title( $next_post->ID ) ); ?></span></span>
</a>
<?php
}
?>
</div><!-- .pagination-single-inner -->
<hr class="styled-separator is-style-wide" aria-hidden="true" />
</nav><!-- .pagination-single -->
<?php
}

View File

@ -0,0 +1,58 @@
<?php
/**
* A template partial to output pagination for the Twenty Twenty default theme.
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
/**
* Translators:
* This text contains HTML to allow the text to be shorter on small screens.
* The text inside the span with the class nav-short will be hidden on small screens.
*/
$prev_text = sprintf(
'%s <span class="nav-prev-text">%s</span>',
'<span aria-hidden="true">&larr;</span>',
__( 'Newer <span class="nav-short">Posts</span>', 'twentytwenty' )
);
$next_text = sprintf(
'<span class="nav-next-text">%s</span> %s',
__( 'Older <span class="nav-short">Posts</span>', 'twentytwenty' ),
'<span aria-hidden="true">&rarr;</span>'
);
$posts_pagination = get_the_posts_pagination(
array(
'mid_size' => 1,
'prev_text' => $prev_text,
'next_text' => $next_text,
)
);
// If we're not outputting the previous page link, prepend a placeholder with `visibility: hidden` to take its place.
if ( strpos( $posts_pagination, 'prev page-numbers' ) === false ) {
$posts_pagination = str_replace( '<div class="nav-links">', '<div class="nav-links"><span class="prev page-numbers placeholder" aria-hidden="true">' . $prev_text . '</span>', $posts_pagination );
}
// If we're not outputting the next page link, append a placeholder with `visibility: hidden` to take its place.
if ( strpos( $posts_pagination, 'next page-numbers' ) === false ) {
$posts_pagination = str_replace( '</div>', '<span class="next page-numbers placeholder" aria-hidden="true">' . $next_text . '</span></div>', $posts_pagination );
}
if ( $posts_pagination ) { ?>
<div class="pagination-wrapper section-inner">
<hr class="styled-separator pagination-separator is-style-wide" aria-hidden="true" />
<?php echo $posts_pagination; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- already escaped during generation. ?>
</div><!-- .pagination-wrapper -->
<?php
}

View File

@ -0,0 +1,33 @@
<?php
/**
* Template Name: Cover Template
* Template Post Type: post, page
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
get_header();
?>
<main id="site-content" role="main">
<?php
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
get_template_part( 'template-parts/content-cover' );
}
}
?>
</main><!-- #site-content -->
<?php get_template_part( 'template-parts/footer-menus-widgets' ); ?>
<?php get_footer(); ?>

View File

@ -0,0 +1,11 @@
<?php
/**
* Template Name: Full Width Template
* Template Post Type: post, page
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since Twenty Twenty 1.0
*/
get_template_part( 'singular' );

View File

@ -0,0 +1,10 @@
<?php
/**
* template name: Accueil
*/
$context = Timber::context();
$timber_post = new Timber\Post();
$context['post'] = $timber_post;
Timber::render( array( 'page-' . $timber_post->post_name . '.twig', 'accueil.twig' ), $context );

View File

@ -1,11 +1,10 @@
<?php
/**
* Template Name: agenda
* template name: Agenda
*/
$context = Timber::context();
$timber_post = new Timber\Post();
$context['post'] = $timber_post;
Timber::render( array( 'page-' . $timber_post->post_name . '.twig', 'page.twig' ), $context );
Timber::render( array( 'page-' . $timber_post->post_name . '.twig', 'agenda.twig' ), $context );

View File

@ -0,0 +1,10 @@
<?php
/**
* template name: Association
*/
$context = Timber::context();
$timber_post = new Timber\Post();
$context['post'] = $timber_post;
Timber::render( array( 'page-' . $timber_post->post_name . '.twig', 'association.twig' ), $context );

View File

@ -53,6 +53,19 @@ Timber::$dirname = array( 'templates', 'views' );
Timber::$autoescape = false;
// REMOVE EDITOR
function remove_editor() {
remove_post_type_support(
'page', 'editor'
);
remove_post_type_support(
'post', 'editor'
);
};
add_action('admin_init', 'remove_editor');
/**
* We're going to configure our theme inside of a subclass of Timber\Site
* You can move this to its own file and include here via php's include("MySite.php")

View File

@ -0,0 +1,54 @@
<?php
function wpc_cpt() {
/* Property */
$labels = array(
'name' => _x('Properties', 'Post Type General Name', 'la_mine'),
'singular_name' => _x('Property', 'Post Type Singular Name', 'la_mine'),
'menu_name' => __('Properties', 'la_mine'),
'name_admin_bar' => __('Properties', 'la_mine'),
'parent_item_colon' => __('Parent Item:', 'la_mine'),
'all_items' => __('All Items', 'la_mine'),
'add_new_item' => __('Add New Item', 'la_mine'),
'add_new' => __('Add New', 'la_mine'),
'new_item' => __('New Item', 'la_mine' ),
'edit_item' => __('Edit Item', 'la_mine'),
'update_item' => __('Update Item', 'la_mine'),
'view_item' => __('View Item', 'la_mine'),
'search_items' => __('Search Item', 'la_mine'),
'not_found' => __('Not found', 'la_mine'),
'not_found_in_trash' => __('Not found in Trash', 'la_mine'),
);
$rewrite = array(
'slug' => _x('property', 'property', 'la_mine'),
'with_front' => true,
'pages' => true,
'feeds' => false,
);
$args = array(
'label' => __('property', 'la_mine'),
'description' => __('Properties', 'la_mine'),
'labels' => $labels,
'supports' => array('title', 'editor', 'thumbnail', 'comments', 'revisions', 'custom-fields'),
'taxonomies' => array('property_type'),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-admin-home',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => false,
'exclude_from_search' => false,
'publicly_queryable' => true,
'query_var' => 'property',
'rewrite' => $rewrite,
'capability_type' => 'page',
);
register_post_type('property', $args);
}
add_action('init', 'wpc_cpt', 10);
?>

View File

@ -0,0 +1,10 @@
<?php
/**
* template name: La bénévole zone
*/
$context = Timber::context();
$timber_post = new Timber\Post();
$context['post'] = $timber_post;
Timber::render( array( 'page-' . $timber_post->post_name . '.twig', 'la_benevole_zone.twig' ), $context );

View File

@ -0,0 +1,10 @@
<?php
/**
* template name: La collecte
*/
$context = Timber::context();
$timber_post = new Timber\Post();
$context['post'] = $timber_post;
Timber::render( array( 'page-' . $timber_post->post_name . '.twig', 'la_collecte.twig' ), $context );

View File

@ -0,0 +1,12 @@
<?php
/**
* template name: Les projets
*/
$context = Timber::context();
$timber_post = new Timber\Post();
$context['post'] = $timber_post;
Timber::render( array( 'les_projets.twig' ), $context );

View File

@ -0,0 +1,10 @@
<?php
/**
* template name: Les temps forts
*/
$context = Timber::context();
$timber_post = new Timber\Post();
$context['post'] = $timber_post;
Timber::render( array( 'page-' . $timber_post->post_name . '.twig', 'les_temps_forts.twig' ), $context );

0
web/app/themes/la_mine/page.php Executable file → Normal file
View File

View File

@ -0,0 +1,10 @@
<?php
/**
* template name: Privatiser l'espace
*/
$context = Timber::context();
$timber_post = new Timber\Post();
$context['post'] = $timber_post;
Timber::render( array( 'page-' . $timber_post->post_name . '.twig', 'privatiser_lespace.twig' ), $context );

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -1,5 +1,6 @@
/*
* Theme Name: My Timber Starter Theme
* Description: Starter Theme to use with Timber
* Author: Upstatement and YOU!
* Theme Name: La mine
* Description: Theming for La mine, construct with timber
* Author: Kévin Tessier & Chloé listrat
* Version: 1.0.0
*/

View File

@ -0,0 +1,14 @@
{% extends "base.twig" %}
{% block content %}
<div class="content-wrapper">
<article class="post-type-{{post.post_type}}" id="post-{{post.ID}}">
<section class="article-content">
<h1 class="article-h1">{{post.title}}</h1>
<div class="article-body">
{{post.content}}
</div>
</section>
</article>
</div><!-- /content-wrapper -->
{% endblock %}

View File

@ -0,0 +1,14 @@
{% extends "base.twig" %}
{% block content %}
<div class="content-wrapper">
<article class="post-type-{{post.post_type}}" id="post-{{post.ID}}">
<section class="article-content">
<h1 class="article-h1">{{post.title}}</h1>
<div class="article-body">
{{post.content}}
</div>
</section>
</article>
</div><!-- /content-wrapper -->
{% endblock %}

View File

@ -0,0 +1,14 @@
{% extends "base.twig" %}
{% block content %}
<div class="content-wrapper">
<article class="post-type-{{post.post_type}}" id="post-{{post.ID}}">
<section class="article-content">
<h1 class="article-h1">{{post.title}}</h1>
<div class="article-body">
{{post.content}}
</div>
</section>
</article>
</div><!-- /content-wrapper -->
{% endblock %}

View File

@ -3,7 +3,7 @@
<div class="comment-content">{{comment.comment_content|wpautop}}</div>
<section class="comment-box">
<!-- comment form -->
{% include "comment-form.twig" %}
@ -18,4 +18,4 @@
{% endif %}
</section>
</div>
</div>

View File

@ -1 +1 @@
Copyright {{"now"|date('Y')}}
Copyright {{"now"|date('Y')}} by FiguresLibres

View File

@ -0,0 +1,14 @@
{% extends "base.twig" %}
{% block content %}
<div class="content-wrapper">
<article class="post-type-{{post.post_type}}" id="post-{{post.ID}}">
<section class="article-content">
<h1 class="article-h1">{{post.title}}</h1>
<div class="article-body">
{{post.content}}
</div>
</section>
</article>
</div><!-- /content-wrapper -->
{% endblock %}

View File

@ -0,0 +1,14 @@
{% extends "base.twig" %}
{% block content %}
<div class="content-wrapper">
<article class="post-type-{{post.post_type}}" id="post-{{post.ID}}">
<section class="article-content">
<h1 class="article-h1">{{post.title}}</h1>
<div class="article-body">
{{post.content}}
</div>
</section>
</article>
</div><!-- /content-wrapper -->
{% endblock %}

View File

@ -0,0 +1,14 @@
{% extends "base.twig" %}
{% block content %}
<div class="content-wrapper">
<article class="post-type-{{post.post_type}}" id="post-{{post.ID}}">
<section class="article-content">
<h1 class="article-h1">{{post.title}}</h1>
<div class="article-body">
{{post.content}}
</div>
</section>
</article>
</div><!-- /content-wrapper -->
{% endblock %}

View File

@ -0,0 +1,14 @@
{% extends "base.twig" %}
{% block content %}
<div class="content-wrapper">
<article class="post-type-{{post.post_type}}" id="post-{{post.ID}}">
<section class="article-content">
<h1 class="article-h1">{{post.title}}</h1>
<div class="article-body">
{{post.content}}
</div>
</section>
</article>
</div><!-- /content-wrapper -->
{% endblock %}

View File

@ -0,0 +1,14 @@
{% extends "base.twig" %}
{% block content %}
<div class="content-wrapper">
<article class="post-type-{{post.post_type}}" id="post-{{post.ID}}">
<section class="article-content">
<h1 class="article-h1">{{post.title}}</h1>
<div class="article-body">
{{post.content}}
</div>
</section>
</article>
</div><!-- /content-wrapper -->
{% endblock %}