Skip to content

Commit

Permalink
feat(pageComponents): add page components to all pages and post types…
Browse files Browse the repository at this point in the history
…, but posts
  • Loading branch information
steffenbew authored Jul 16, 2020
1 parent 1ebc27b commit f218164
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
7 changes: 1 addition & 6 deletions inc/fieldGroups/pageComponents.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,8 @@
[
[
'param' => 'post_type',
'operator' => '==',
'value' => 'page'
],
[
'param' => 'page_type',
'operator' => '!=',
'value' => 'posts_page'
'value' => 'post'
]
]
]
Expand Down
2 changes: 2 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<?php

use Timber\Timber;
use Timber\Post;
use Timber\PostQuery;
use Flynt\Utils\Options;

use const Flynt\Archives\POST_TYPES;

$context = Timber::get_context();
$context['post'] = new Post();
$context['posts'] = new PostQuery();

if (isset($_GET['contentOnly'])) {
Expand Down
3 changes: 3 additions & 0 deletions templates/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

{% block content %}
{{ renderComponent('GridPostsArchive', { posts: posts }) }}
{% for component in post.meta('pageComponents') %}
{{ renderComponent(component) }}
{% endfor %}
{% endblock %}

0 comments on commit f218164

Please # to comment.