add info footer

This commit is contained in:
Kevin Tessier 2020-05-27 11:08:34 +02:00
parent 270ed287db
commit 192ecc579e
9 changed files with 31 additions and 47 deletions

View File

@ -1,21 +0,0 @@
<?php
/**
* Third party plugins that hijack the theme will call wp_footer() to get the footer template.
* We use this to end our output buffer (started in header.php) and render into the view/page-plugin.twig template.
*
* If you're not using a plugin that requries this behavior (ones that do include Events Calendar Pro and
* WooCommerce) you can delete this file and header.php
*
* @package WordPress
* @subpackage Timber
* @since Timber 0.1
*/
$timberContext = $GLOBALS['timberContext']; // @codingStandardsIgnoreFile
if ( ! isset( $timberContext ) ) {
throw new \Exception( 'Timber context not set in footer.' );
}
$timberContext['content'] = ob_get_contents();
ob_end_clean();
$templates = array( 'page-plugin.twig' );
Timber::render( $templates, $timberContext );

View File

@ -22,23 +22,28 @@ if ( file_exists( $composer_autoload ) ) {
if( function_exists('acf_add_options_page') ) {
acf_add_options_page(array(
'page_title' => 'Information',
'menu_title' => 'Information',
'icon_url' => 'dashicons-buddicons-activity',
'capability' => 'edit_posts',
'redirect' => false
));
acf_add_options_page(array(
'page_title' => 'Information',
'menu_title' => 'Information',
'menu_slug' => 'information',
'capability' => 'edit_posts',
'redirect' => false
));
acf_add_options_sub_page(array(
'page_title' => 'Partenaires',
'menu_title' => 'Partenaires',
'parent_slug' => 'information',
));
acf_add_options_page(array(
'page_title' => 'Partenaires',
'menu_title' => 'Partenaires',
'icon_url' => 'dashicons-buddicons-activity',
'capability' => 'edit_posts',
'redirect' => false
));
}
add_filter( 'timber_context', 'options_footer' );
function options_footer( $context ) {
$context['options'] = get_fields('option');
return $context;
}
/**
* This ensures that Timber is loaded and available as a PHP class.

View File

@ -15,9 +15,9 @@
$context = Timber::context();
$context['posts'] = new Timber\PostQuery();
$context['foo'] = 'bar';
$templates = array( 'index.twig' );
$templates = array( 'base.twig' );
if ( is_home() ) {
array_unshift( $templates, 'front-page.twig', 'home.twig' );
array_unshift( $templates, 'front-page.twig', 'accueil.twig' );
}
Timber::render( $templates, $context );

View File

@ -7,6 +7,7 @@
{% endblock %}
<body class="{{body_class}}" data-template="base.twig">
<a class="skip-link screen-reader-text" href="#content">{{ _e( 'Skip to content') }}</a>
<header class="header">
{% block header %}
@ -35,7 +36,7 @@
{% endif %}
</section>
{% block footer %}
{% block footer %}
<footer id="footer">
{% include 'footer.twig' %}
</footer>

View File

@ -1 +1,2 @@
Copyright {{"now"|date('Y')}} by FiguresLibres
{{ dump(options) }}
<h3>{{ site_options }}</h3>

View File

@ -1,11 +1,9 @@
{% extends "base.twig" %}
{% block content %}
<h2>{{ foo }}</h2>
<p>{{ qux }}</p>
{% for post in posts %}
{% include ['tease-'~post.post_type~'.twig', 'tease.twig'] %}
{% endfor %}
{% include 'partial/pagination.twig' with { pagination: posts.pagination({show_all: false, mid_size: 3, end_size: 2}) } %}
{% endblock %}

View File

@ -4,4 +4,4 @@
<div class="container content-wrapper">
{{content}}
</div><!-- /content-wrapper -->
{% endblock %}
{% endblock %}

View File

@ -11,4 +11,4 @@
</section>
</article>
</div><!-- /content-wrapper -->
{% endblock %}
{% endblock %}

View File

@ -13,7 +13,7 @@
</div>
<div class="__body">
{{ post.meta('paragraphe_descriptif') }}
{{ post.meta('paragraphe_descriptif') }}
</div>
</div>
@ -50,7 +50,7 @@
{% endfor %}
</div>
{% include 'temcomponents/buttons/boutton_privatiser.html.twigplate'%}
{% include 'components/buttons/boutton_privatiser.html.twig' %}
</div>