diff --git a/wp-content/themes/cosmopet-timber/.gitattributes b/wp-content/themes/cosmopet-timber/.gitattributes
new file mode 100644
index 0000000..2e1912c
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/.gitattributes
@@ -0,0 +1,4 @@
+/.gitattributes export-ignore
+/.github export-ignore
+/tests export-ignore
+/phpunit.xml
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet-timber/.github/PULL_REQUEST_TEMPLATE.md b/wp-content/themes/cosmopet-timber/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..626a6ed
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,35 @@
+
+
+
+
+Related:
+
+- Ticket 1
+- Ticket 2
+
+## Issue
+
+
+
+## Solution
+
+
+
+## Impact
+
+
+
+## Usage Changes
+
+
+## Considerations
+
+
+
+## Testing
+
diff --git a/wp-content/themes/cosmopet-timber/.github/workflows/test.yml b/wp-content/themes/cosmopet-timber/.github/workflows/test.yml
new file mode 100644
index 0000000..f949e1e
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/.github/workflows/test.yml
@@ -0,0 +1,76 @@
+name: Timber starter theme tests
+
+on:
+ push:
+ branches:
+ - '1.x'
+ - '2.x'
+ pull_request:
+ types:
+ - opened
+ - synchronize
+ - ready_for_review
+
+# Cancel previous workflow run groups that have not completed.
+concurrency:
+ # Group workflow runs by workflow name, along with the head branch ref of the pull request
+ # or otherwise the branch or tag ref.
+ group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ phpunit:
+ runs-on: ubuntu-latest
+
+ continue-on-error: ${{ matrix.experimental }}
+ strategy:
+ fail-fast: false
+ matrix:
+ php: ['8.1', '8.2']
+ wp: ['latest']
+ multisite: ['0', '1']
+ extensions: ['gd']
+ experimental: [false]
+ include:
+ # PHP 8.2 / experimental
+ - php: '8.2'
+ wp: 'trunk'
+ dependency-version: 'highest'
+ multisite: '0'
+ experimental: true
+ # PHP 8.3 / experimental
+ - php: '8.3'
+ wp: 'trunk'
+ dependency-version: 'highest'
+ multisite: '0'
+ experimental: true
+ # Coverage
+ - php: '8.1'
+ wp: 'latest'
+ dependency-version: 'highest'
+ multisite: '0'
+ experimental: false
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Setup PHP
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: ${{ matrix.php }}
+ tools: composer:v2
+ extensions: curl, date, dom, iconv, json, libxml, gd
+
+ - name: Setup problem matchers for PHP
+ run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
+
+ - name: Setup problem matchers for PHPUnit
+ run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
+
+ - uses: ramsey/composer-install@v3
+
+ - name: Run tests
+ run: composer run test
+ env:
+ WP_MULTISITE: ${{ matrix.multisite }}
diff --git a/wp-content/themes/cosmopet-timber/.gitignore b/wp-content/themes/cosmopet-timber/.gitignore
new file mode 100644
index 0000000..9477bf3
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/.gitignore
@@ -0,0 +1,4 @@
+/composer.lock
+/vendor/
+/wordpress/
+.phpunit.result.cache
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet-timber/404.php b/wp-content/themes/cosmopet-timber/404.php
new file mode 100644
index 0000000..a51168d
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/404.php
@@ -0,0 +1,11 @@
+ $title,
+ ]
+);
+
+Timber::render( $templates, $context );
diff --git a/wp-content/themes/cosmopet-timber/assets/fonts/.gitkeep b/wp-content/themes/cosmopet-timber/assets/fonts/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/wp-content/themes/cosmopet-timber/assets/images/.gitkeep b/wp-content/themes/cosmopet-timber/assets/images/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/wp-content/themes/cosmopet-timber/assets/scripts/site.js b/wp-content/themes/cosmopet-timber/assets/scripts/site.js
new file mode 100644
index 0000000..6655bd0
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/assets/scripts/site.js
@@ -0,0 +1,5 @@
+jQuery( document ).ready( function( $ ) {
+
+ // Your JavaScript goes here
+
+});
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet-timber/assets/styles/.gitkeep b/wp-content/themes/cosmopet-timber/assets/styles/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/wp-content/themes/cosmopet-timber/author.php b/wp-content/themes/cosmopet-timber/author.php
new file mode 100644
index 0000000..dae48bc
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/author.php
@@ -0,0 +1,18 @@
+name() );
+}
+
+Timber::render( [ 'templates/author.twig', 'templates/archive.twig' ], $context );
diff --git a/wp-content/themes/cosmopet-timber/composer.json b/wp-content/themes/cosmopet-timber/composer.json
new file mode 100644
index 0000000..1e1dcd5
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/composer.json
@@ -0,0 +1,75 @@
+{
+ "name": "timber/starter-theme",
+ "description": "Starter theme to build a Timber theme",
+ "type":"wordpress-theme",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Erik van der Bas",
+ "email": "erik@basedonline.nl",
+ "homepage": "https://basedonline.nl"
+ },
+ {
+ "name": "Lukas Gächter",
+ "email": "lukas.gaechter@mind.ch",
+ "homepage": "https://www.mind.ch"
+ },
+ {
+ "name": "Nicolas Lemoine",
+ "email": "nico@n5s.dev",
+ "homepage": "https://n5s.dev"
+ },
+ {
+ "name": "Jared Novack",
+ "email": "jared@upstatement.com",
+ "homepage": "https://upstatement.com"
+ },
+ {
+ "name": "Timber Community",
+ "homepage": "https://github.com/timber/timber"
+ }
+ ],
+ "repositories": [
+ {
+ "type": "composer",
+ "url": "https://wpackagist.org"
+ }
+ ],
+ "require": {
+ "timber/timber": "^2.1"
+ },
+ "require-dev": {
+ "automattic/wordbless": "^0.4.2",
+ "yoast/wp-test-utils": "^1.0",
+ "wp-coding-standards/wpcs": "^3.1",
+ "phpcompatibility/php-compatibility": "^9",
+ "szepeviktor/phpstan-wordpress": "^1.3",
+ "10up/phpcs-composer": "^3.0"
+ },
+ "extra": {
+ "installer-paths": {
+ "vendor/automattic/wordbless/": [
+ "automattic/wordbless"
+ ]
+ },
+ "wordpress-install-dir": "wordpress"
+ },
+ "config": {
+ "allow-plugins": {
+ "roots/wordpress-core-installer": true,
+ "composer/installers": true,
+ "dealerdirect/phpcodesniffer-composer-installer": true
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "App\\": "src/"
+ }
+ },
+ "scripts": {
+ "test": "phpunit",
+ "cs": "@php ./vendor/bin/phpcs --colors -s -p -v ./",
+ "cs:fix": "@php ./vendor/bin/phpcbf --colors -s -p -v ./",
+ "phpstan": "@php ./vendor/bin/phpstan analyse"
+ }
+}
diff --git a/wp-content/themes/cosmopet-timber/functions.php b/wp-content/themes/cosmopet-timber/functions.php
new file mode 100644
index 0000000..76890b8
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/functions.php
@@ -0,0 +1,19 @@
+ 'bar',
+ ]
+);
+
+Timber::render( $templates, $context );
diff --git a/wp-content/themes/cosmopet-timber/page.php b/wp-content/themes/cosmopet-timber/page.php
new file mode 100644
index 0000000..34c142d
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/page.php
@@ -0,0 +1,17 @@
+
+
+
+ .
+
+ */node_modules/*
+ */wordpress/*
+ */vendor/*
+ */resources/*
+ */dist/*
+ */tests/*
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet-timber/phpstan.neon b/wp-content/themes/cosmopet-timber/phpstan.neon
new file mode 100644
index 0000000..5ce8f6d
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/phpstan.neon
@@ -0,0 +1,15 @@
+parameters:
+ editorUrl: 'vscode://file/%%file%%:%%line%%'
+ level: 5 # Increase until "max"
+ paths:
+ - src/
+ - %currentWorkingDirectory%/
+ excludePaths:
+ - tests/*
+ - docs/*
+ - vendor/*
+ - wordpress/*
+ ignoreErrors:
+
+includes:
+ - vendor/szepeviktor/phpstan-wordpress/extension.neon
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet-timber/phpunit.xml b/wp-content/themes/cosmopet-timber/phpunit.xml
new file mode 100644
index 0000000..c0f40d4
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/phpunit.xml
@@ -0,0 +1,14 @@
+
+
+
+ ./tests/
+
+
+
diff --git a/wp-content/themes/cosmopet-timber/screenshot.png b/wp-content/themes/cosmopet-timber/screenshot.png
new file mode 100644
index 0000000..f37bb02
Binary files /dev/null and b/wp-content/themes/cosmopet-timber/screenshot.png differ
diff --git a/wp-content/themes/cosmopet-timber/search.php b/wp-content/themes/cosmopet-timber/search.php
new file mode 100644
index 0000000..9e1ac5f
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/search.php
@@ -0,0 +1,18 @@
+ 'Search results for ' . get_search_query(),
+ ]
+);
+
+Timber::render( $templates, $context );
diff --git a/wp-content/themes/cosmopet-timber/single.php b/wp-content/themes/cosmopet-timber/single.php
new file mode 100644
index 0000000..df070cf
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/single.php
@@ -0,0 +1,20 @@
+post_type . '.twig', 'templates/single.twig' ];
+
+if ( post_password_required( $post->ID ) ) {
+ $templates = 'templates/single-password.twig';
+}
+
+Timber::render( $templates, $context );
diff --git a/wp-content/themes/cosmopet-timber/src/StarterSite.php b/wp-content/themes/cosmopet-timber/src/StarterSite.php
new file mode 100644
index 0000000..834eaad
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/src/StarterSite.php
@@ -0,0 +1,186 @@
+ _x( 'Main menu', 'Backend - menu name', 'timber-starter' ),
+ ]
+ );
+
+ // Add default posts and comments RSS feed links to head.
+ add_theme_support( 'automatic-feed-links' );
+
+ /*
+ * Let WordPress manage the document title.
+ * By adding theme support, we declare that this theme does not use a
+ * hard-coded
tag in the document head, and expect WordPress to
+ * provide it for us.
+ */
+ add_theme_support( 'title-tag' );
+
+ /*
+ * 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' );
+
+ /*
+ * Switch default core markup for search form, comment form, and comments
+ * to output valid HTML5.
+ */
+ add_theme_support(
+ 'html5',
+ [
+ 'comment-form',
+ 'comment-list',
+ 'gallery',
+ 'caption',
+ ]
+ );
+
+ /*
+ * Enable support for Post Formats.
+ *
+ * See: https://codex.wordpress.org/Post_Formats
+ */
+ add_theme_support(
+ 'post-formats',
+ [
+ 'aside',
+ 'image',
+ 'video',
+ 'quote',
+ 'link',
+ 'gallery',
+ 'audio',
+ ]
+ );
+
+ add_theme_support( 'menus' );
+ }
+
+ /**
+ * This would return 'foo bar!'.
+ *
+ * @param string $text being 'foo', then returned 'foo bar!'
+ */
+ public function myfoo( $text ) {
+ $text .= ' bar!';
+
+ return $text;
+ }
+
+ /**
+ * This is where you can add your own functions to twig.
+ *
+ * @link https://timber.github.io/docs/v2/hooks/filters/#timber/twig/filters
+ * @param array $filters an array of Twig filters.
+ */
+ public function add_filters_to_twig( $filters ) {
+
+ $additional_filters = [
+ 'myfoo' => [
+ 'callable' => [ $this, 'myfoo' ],
+ ],
+ ];
+
+ return array_merge( $filters, $additional_filters );
+ }
+
+
+ /**
+ * This is where you can add your own functions to twig.
+ *
+ * @link https://timber.github.io/docs/v2/hooks/filters/#timber/twig/functions
+ * @param array $functions an array of existing Twig functions.
+ */
+ public function add_functions_to_twig( $functions ) {
+ $additional_functions = [
+ 'get_theme_mod' => [
+ 'callable' => 'get_theme_mod',
+ ],
+ ];
+
+ return array_merge( $functions, $additional_functions );
+ }
+
+ /**
+ * Updates Twig environment options.
+ *
+ * @see https://twig.symfony.com/doc/2.x/api.html#environment-options
+ *
+ * @param array $options an array of environment options
+ *
+ * @return array
+ */
+ public function update_twig_environment_options( $options ) {
+ // $options['autoescape'] = true;
+
+ return $options;
+ }
+}
diff --git a/wp-content/themes/cosmopet-timber/src/style.css b/wp-content/themes/cosmopet-timber/src/style.css
new file mode 100644
index 0000000..e7b0324
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/src/style.css
@@ -0,0 +1,5 @@
+/*
+ * Theme Name: Cosmopet Theme
+ * Description: Boilerplate Theme for Cosmopet site
+ * Author: Good Production
+*/
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet-timber/style.css b/wp-content/themes/cosmopet-timber/style.css
new file mode 100644
index 0000000..e8aa430
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/style.css
@@ -0,0 +1,5 @@
+/*
+ * Theme Name: Cosmopet Theme
+ * Description: Boilerplate Theme for Cosmopet site
+ * Author: Good Production
+*/
diff --git a/wp-content/themes/cosmopet-timber/tests/bootstrap.php b/wp-content/themes/cosmopet-timber/tests/bootstrap.php
new file mode 100644
index 0000000..fb3f982
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/tests/bootstrap.php
@@ -0,0 +1,28 @@
+assertTrue(is_array($context));
+ }
+
+ function testFunctionsPHP()
+ {
+ $context = Timber::context();
+ $this->assertEquals('App\StarterSite', get_class($context['site']));
+ $this->assertTrue(current_theme_supports('post-thumbnails'));
+ $this->assertEquals('bar', $context['foo']);
+ }
+
+ function testLoading()
+ {
+ $str = Timber::compile('partials/tease.twig');
+ $this->assertStringStartsWith('', $str);
+ $this->assertStringEndsWith('', $str);
+ }
+
+ /**
+ * Helper test to output current twig version
+ */
+ function testTwigVersion()
+ {
+ $version = Timber::compile_string("{{ version }}", ['version' => Twig\Environment::VERSION]);
+ $this->assertEquals(Twig\Environment::VERSION, $version);
+ }
+
+ // function testTwigFilter() {
+ // $str = Timber::compile_string('{{ "foo"|myfoo }}');
+ // $this->assertEquals('foo bar!', $str);
+ // }
+}
diff --git a/wp-content/themes/cosmopet-timber/views/layouts/base.twig b/wp-content/themes/cosmopet-timber/views/layouts/base.twig
new file mode 100644
index 0000000..537c08d
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/views/layouts/base.twig
@@ -0,0 +1,43 @@
+
+
+ {% block head %}
+ {% include 'partials/head.twig' %}
+ {% endblock %}
+
+
+ {{ function('wp_body_open') }}
+ {{ _e('Skip to content') }}
+
+
+
+ {% if title %}
+ {{ title }}
+ {% endif %}
+
+ {% block content %}
+ Sorry, no content
+ {% endblock %}
+
+
+
+ {% block footer %}
+ {% include 'partials/footer.twig' %}
+ {% endblock %}
+ {{ function('wp_footer') }}
+ {% do action('get_footer') %}
+
+
diff --git a/wp-content/themes/cosmopet-timber/views/partials/comment-form.twig b/wp-content/themes/cosmopet-timber/views/partials/comment-form.twig
new file mode 100644
index 0000000..565f4b6
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/views/partials/comment-form.twig
@@ -0,0 +1,32 @@
+
diff --git a/wp-content/themes/cosmopet-timber/views/partials/comment.twig b/wp-content/themes/cosmopet-timber/views/partials/comment.twig
new file mode 100644
index 0000000..710f979
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/views/partials/comment.twig
@@ -0,0 +1,19 @@
+
diff --git a/wp-content/themes/cosmopet-timber/views/partials/footer.twig b/wp-content/themes/cosmopet-timber/views/partials/footer.twig
new file mode 100644
index 0000000..606165c
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/views/partials/footer.twig
@@ -0,0 +1 @@
+
diff --git a/wp-content/themes/cosmopet-timber/views/partials/head.twig b/wp-content/themes/cosmopet-timber/views/partials/head.twig
new file mode 100644
index 0000000..ea68c2a
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/views/partials/head.twig
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+ {% do action('get_header') %}
+ {{ function('wp_head') }}
+
diff --git a/wp-content/themes/cosmopet-timber/views/partials/menu.twig b/wp-content/themes/cosmopet-timber/views/partials/menu.twig
new file mode 100644
index 0000000..377dc98
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/views/partials/menu.twig
@@ -0,0 +1,12 @@
+{% if menu %}
+
+ {% for item in items %}
+ -
+ {{ item.title }}
+ {% include 'partials/menu.twig' with {
+ items: item.children
+ } %}
+
+ {% endfor %}
+
+{% endif %}
diff --git a/wp-content/themes/cosmopet-timber/views/partials/pagination.twig b/wp-content/themes/cosmopet-timber/views/partials/pagination.twig
new file mode 100644
index 0000000..e4d737b
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/views/partials/pagination.twig
@@ -0,0 +1,44 @@
+{% if posts.pagination.pages is not empty %}
+
+{% endif %}
diff --git a/wp-content/themes/cosmopet-timber/views/partials/tease-post.twig b/wp-content/themes/cosmopet-timber/views/partials/tease-post.twig
new file mode 100644
index 0000000..5a08767
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/views/partials/tease-post.twig
@@ -0,0 +1,16 @@
+{% extends 'partials/tease.twig' %}
+
+{% block content %}
+
+
+ {{
+ post.excerpt({
+ words: 5,
+ read_more: 'Keep reading'
+ })
+ }}
+
+ {% if post.thumbnail.src %}
+
+ {% endif %}
+{% endblock %}
diff --git a/wp-content/themes/cosmopet-timber/views/partials/tease.twig b/wp-content/themes/cosmopet-timber/views/partials/tease.twig
new file mode 100644
index 0000000..1a0f7b0
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/views/partials/tease.twig
@@ -0,0 +1,9 @@
+
+ {% block content %}
+
+ {{ post.excerpt }}
+ {% if post.thumbnail %}
+
+ {% endif %}
+ {% endblock %}
+
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet-timber/views/templates/404.twig b/wp-content/themes/cosmopet-timber/views/templates/404.twig
new file mode 100644
index 0000000..1b2073c
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/views/templates/404.twig
@@ -0,0 +1,5 @@
+{% extends 'layouts/base.twig' %}
+
+{% block content %}
+ Sorry, we couldn't find what you're looking for.
+{% endblock %}
diff --git a/wp-content/themes/cosmopet-timber/views/templates/archive.twig b/wp-content/themes/cosmopet-timber/views/templates/archive.twig
new file mode 100644
index 0000000..ae021ea
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/views/templates/archive.twig
@@ -0,0 +1,15 @@
+{% extends 'layouts/base.twig' %}
+
+{% block content %}
+ {% for post in posts %}
+ {% include ['partials/tease-' ~ post.type ~ '.twig', 'partials/tease.twig'] %}
+ {% endfor %}
+
+ {% include 'partials/pagination.twig' with {
+ pagination: posts.pagination({
+ show_all: false,
+ mid_size: 3,
+ end_size: 2
+ })
+ } %}
+{% endblock %}
diff --git a/wp-content/themes/cosmopet-timber/views/templates/author.twig b/wp-content/themes/cosmopet-timber/views/templates/author.twig
new file mode 100644
index 0000000..6d19761
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/views/templates/author.twig
@@ -0,0 +1,7 @@
+{% extends 'layouts/base.twig' %}
+
+{% block content %}
+ {% for post in posts %}
+ {% include ['partials/tease-' ~ post.type ~ '.twig', 'partials/tease.twig'] %}
+ {% endfor %}
+{% endblock %}
diff --git a/wp-content/themes/cosmopet-timber/views/templates/index.twig b/wp-content/themes/cosmopet-timber/views/templates/index.twig
new file mode 100644
index 0000000..b68fbd7
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/views/templates/index.twig
@@ -0,0 +1,16 @@
+{% extends 'layouts/base.twig' %}
+
+{% block content %}
+ {{ foo }}
+ {% for post in posts %}
+ {% include ['partials/tease-' ~ post.type ~ '.twig', 'partials/tease.twig'] %}
+ {% endfor %}
+
+ {% include 'partials/pagination.twig' with {
+ pagination: posts.pagination({
+ show_all: false,
+ mid_size: 3,
+ end_size: 2
+ })
+ } %}
+{% endblock %}
diff --git a/wp-content/themes/cosmopet-timber/views/templates/page.twig b/wp-content/themes/cosmopet-timber/views/templates/page.twig
new file mode 100644
index 0000000..7709c52
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/views/templates/page.twig
@@ -0,0 +1,12 @@
+{% extends 'layouts/base.twig' %}
+
+{% block content %}
+
+
+
+ {{ post.title }}
+ {{ post.content }}
+
+
+
+{% endblock %}
diff --git a/wp-content/themes/cosmopet-timber/views/templates/search.twig b/wp-content/themes/cosmopet-timber/views/templates/search.twig
new file mode 100644
index 0000000..f8853a6
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/views/templates/search.twig
@@ -0,0 +1,18 @@
+{# see `templates/archive.twig` for an alternative strategy of extending templates #}
+{% extends 'layouts/base.twig' %}
+
+{% block content %}
+
+ {% for post in posts %}
+ {% include ['partials/tease-' ~ post.type ~ '.twig', 'partials/tease.twig'] %}
+ {% endfor %}
+
+ {% include 'partials/pagination.twig' with {
+ pagination: posts.pagination({
+ show_all: false,
+ mid_size: 3,
+ end_size: 2
+ })
+ } %}
+
+{% endblock %}
diff --git a/wp-content/themes/cosmopet-timber/views/templates/single-password.twig b/wp-content/themes/cosmopet-timber/views/templates/single-password.twig
new file mode 100644
index 0000000..fc62761
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/views/templates/single-password.twig
@@ -0,0 +1,17 @@
+{% extends 'layouts/base.twig' %}
+
+{% block content %}
+
+{% endblock %}
diff --git a/wp-content/themes/cosmopet-timber/views/templates/single.twig b/wp-content/themes/cosmopet-timber/views/templates/single.twig
new file mode 100644
index 0000000..584450d
--- /dev/null
+++ b/wp-content/themes/cosmopet-timber/views/templates/single.twig
@@ -0,0 +1,37 @@
+{% extends 'layouts/base.twig' %}
+
+{% block content %}
+
+
+
+
+ {{ post.title }}
+
+ By
+ {{ post.author.name }}
+ •
+
+
+ {{ post.content }}
+
+
+
+
+{% endblock %}
diff --git a/wp-content/themes/cosmopet/functions.php b/wp-content/themes/cosmopet/functions.php
index c178e1b..e38e470 100644
--- a/wp-content/themes/cosmopet/functions.php
+++ b/wp-content/themes/cosmopet/functions.php
@@ -14,7 +14,12 @@ Timber::$dirname = [
],
];
+function theme_add_woocommerce_support()
+{
+ add_theme_support('woocommerce');
+}
+add_action('after_setup_theme', 'theme_add_woocommerce_support');
add_theme_support('post-thumbnails');
//Подруключение всех ajax controller если запрос сделан по ajax
@@ -365,14 +370,26 @@ function enqueue_static_assets($dir_name, $options = []) {
}
}
+
+add_action('init', function() {
+ if (function_exists('wpseo_load_textdomain')) {
+ wpseo_load_textdomain();
+ }
+ if (function_exists('pll_load_textdomain')) {
+ pll_load_textdomain();
+ }
+ add_filter('timber/context', function($context) {
+ $context['current_lang'] = pll_current_language();
+ return $context;
+ });
+}, 1);
+
+
$modules_path = get_template_directory() . '/modules/*/editor-blocks/*/editor-block-controller.php';
foreach (glob($modules_path) as $file) {
require_once $file; // Подключаем каждый найденный файл
}
-add_filter('timber/context', function($context) {
- $context['current_lang'] = pll_current_language();
- return $context;
-});
+
requireShortcodes(get_template_directory() . '/modules');
diff --git a/wp-content/themes/cosmopet/global-functions/multilang-functions.php b/wp-content/themes/cosmopet/global-functions/multilang-functions.php
index cff45b2..98d131e 100644
--- a/wp-content/themes/cosmopet/global-functions/multilang-functions.php
+++ b/wp-content/themes/cosmopet/global-functions/multilang-functions.php
@@ -1,41 +1,43 @@
скидку!', 'Узнайте о нас больше и получите скидку!');
+ pll_register_string ('Это миф!', 'Это миф!');
+ pll_register_string ('Это правда!', 'Это правда!');
+ pll_register_string ('Правда', 'Правда');
+ pll_register_string ('Миф', 'Миф');
+ pll_register_string ('Далее', 'Далее');
+ pll_register_string ('ваш результат', 'ваш результат');
+ pll_register_string ('Скопировать', 'Скопировать');
+ pll_register_string ('Скопировано', 'Скопировано');
+ pll_register_string ('В магазин', 'В магазин');
+ pll_register_string ('Наш блог', 'Наш блог');
+ pll_register_string ('Новости рынка кормов и экологии, полезные статьи о здоровье домашних животных', 'Новости рынка кормов и экологии, полезные статьи о здоровье домашних животных');
+ pll_register_string ('ЭТАПЫ ПРОИЗВОД­СТВА', 'ЭТАПЫ ПРОИЗВОД­СТВА');
+ pll_register_string ('Этапы производс­тва корма', 'Этапы производс­тва корма');
+ pll_register_string ('Все статьи', 'Все статьи');
+ pll_register_string ('Узнать больше', 'Узнать больше');
+});
-pll_register_string ('Темы', 'Темы');
-pll_register_string ('САМЫЕ ЧИТАЕМЫЕ', 'САМЫЕ ЧИТАЕМЫЕ');
-pll_register_string ('время чтения', 'время чтения');
-pll_register_string ('ВСЕ СТАТЬИ', 'ВСЕ СТАТЬИ');
-pll_register_string ('ПРЕДЛОЖИТЕ СТАТЬЮ ИЛИ СТАНЬТЕ АВТОРОМ', 'ПРЕДЛОЖИТЕ СТАТЬЮ ИЛИ СТАНЬТЕ АВТОРОМ');
-pll_register_string ('НАПИШИТЕ НАМ', 'НАПИШИТЕ НАМ');
-pll_register_string ('COSMO тема редакции', 'COSMO тема редакции');
-pll_register_string ('мин.', 'мин.');
-pll_register_string ('Форма обратной связи', 'Форма обратной связи');
-pll_register_string ('Ваше имя', 'Ваше имя');
-pll_register_string ('Эл.почта', 'Эл.почта');
-pll_register_string ('Текст обращения', 'Текст обращения');
-pll_register_string ('Отправить', 'Отправить');
-pll_register_string ('Чат бот с ветеринаром', 'Чат бот с ветеринаром');
-pll_register_string ('Калькулятор рациона', 'Калькулятор рациона');
-pll_register_string ('ПОКАЗАТЬ ЕЩЁ', 'ПОКАЗАТЬ ЕЩЁ');
-pll_register_string ('ВСЕ', 'ВСЕ');
-pll_register_string ('читать статью', 'читать статью');
-pll_register_string ('Блог', 'Блог');
-pll_register_string ('Главная', 'Главная');
-pll_register_string ('Подпишитесь, чтобы быть в курсе деятельности Cosmopet и узнавать о наших, предложениях. Обещаем не заваливать вас бесполезными письмами. А за подписку дарим -25% на весь ассортимент нашей продукции', 'Подпишитесь, чтобы быть в курсе деятельности Cosmopet и узнавать о наших предложениях. Обещаем не заваливать вас бесполезными письмами. А за подписку дарим -25% на весь ассортимент нашей продукции');
-pll_register_string ('Подписываясь на рассылку, я даю согласие на обработку персональных данных, на получение рекламных сообщений и новостей о товарах и услугах', 'Подписываясь на рассылку, я даю согласие на обработку персональных данных, на получение рекламных сообщений и новостей о товарах и услугах');
-pll_register_string ('подписаться', 'подписаться');
-pll_register_string ('Узнайте о нас больше и получите скидку!', 'Узнайте о нас больше и получите скидку!');
-pll_register_string ('Это миф!', 'Это миф!');
-pll_register_string ('Это правда!', 'Это правда!');
-pll_register_string ('Правда', 'Правда');
-pll_register_string ('Миф', 'Миф');
-pll_register_string ('Далее', 'Далее');
-pll_register_string ('ваш результат', 'ваш результат');
-pll_register_string ('Скопировать', 'Скопировать');
-pll_register_string ('Скопировано', 'Скопировано');
-pll_register_string ('В магазин', 'В магазин');
-pll_register_string ('Наш блог', 'Наш блог');
-pll_register_string ('Новости рынка кормов и экологии, полезные статьи о здоровье домашних животных', 'Новости рынка кормов и экологии, полезные статьи о здоровье домашних животных');
-pll_register_string ('ЭТАПЫ ПРОИЗВОД­СТВА', 'ЭТАПЫ ПРОИЗВОД­СТВА');
-pll_register_string ('Этапы производс­тва корма', 'Этапы производс­тва корма');
-pll_register_string ('Все статьи', 'Все статьи');
-pll_register_string ('Узнать больше', 'Узнать больше');
diff --git a/wp-content/themes/cosmopet/templates/layout.twig b/wp-content/themes/cosmopet/templates/layout.twig
index 1a88a14..1938e5b 100644
--- a/wp-content/themes/cosmopet/templates/layout.twig
+++ b/wp-content/themes/cosmopet/templates/layout.twig
@@ -13,7 +13,6 @@
{% include 'header.twig' %}
-
{% block content %}
{% endblock %}
diff --git a/wp-content/themes/cosmopet/templates/shop/index.php b/wp-content/themes/cosmopet/templates/shop/index.php
index e69de29..d800886 100644
--- a/wp-content/themes/cosmopet/templates/shop/index.php
+++ b/wp-content/themes/cosmopet/templates/shop/index.php
@@ -0,0 +1 @@
+123
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet/templates/shop/shop.twig b/wp-content/themes/cosmopet/templates/shop/shop.twig
index e69de29..d800886 100644
--- a/wp-content/themes/cosmopet/templates/shop/shop.twig
+++ b/wp-content/themes/cosmopet/templates/shop/shop.twig
@@ -0,0 +1 @@
+123
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet/woocommerce/archive-product.php b/wp-content/themes/cosmopet/woocommerce/archive-product.php
new file mode 100644
index 0000000..bf7423d
--- /dev/null
+++ b/wp-content/themes/cosmopet/woocommerce/archive-product.php
@@ -0,0 +1,40 @@
+ 'post',
+// // 'posts_per_page' => 6,
+// // );
+
+// // $posts = new WP_Query($args);
+// $formatted_posts = array();
+
+// if (have_posts()) {
+// while (have_posts()) {
+// the_post();
+
+// $formatted_post = array(
+// 'title' => get_the_title(),
+// 'link' => get_permalink(),
+// 'excerpt' => get_the_excerpt(),
+// 'thumbnail' => has_post_thumbnail()
+// ? get_the_post_thumbnail_url(get_the_ID(), 'full')
+// : get_template_directory_uri() . "/static/front-page/img/blog_card-img.jpg"
+// );
+
+// $formatted_posts[] = $formatted_post;
+// }
+// wp_reset_postdata();
+// }
+
+// return $formatted_posts;
+ // }
+
+ $context = Timber::get_context();
+ $context['posts'] = Timber::get_posts();
+
+
+
+ Timber::render('archive-product/archive-product.twig', $context);
+
+?>
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet/woocommerce/archive-product/archive-product.twig b/wp-content/themes/cosmopet/woocommerce/archive-product/archive-product.twig
new file mode 100644
index 0000000..7760521
--- /dev/null
+++ b/wp-content/themes/cosmopet/woocommerce/archive-product/archive-product.twig
@@ -0,0 +1,12 @@
+{% set bodyClass = 'main-np' %}
+{% extends 'layout.twig' %}
+
+
+{% block content %}
+
+{% for post in posts %}
+ {{ post.title }}
+
+{% endfor %}
+
+{% endblock %}
\ No newline at end of file
Add comment
+ +