add info footer
This commit is contained in:
parent
270ed287db
commit
192ecc579e
@ -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 );
|
|
@ -25,20 +25,25 @@ if( function_exists('acf_add_options_page') ) {
|
|||||||
acf_add_options_page(array(
|
acf_add_options_page(array(
|
||||||
'page_title' => 'Information',
|
'page_title' => 'Information',
|
||||||
'menu_title' => 'Information',
|
'menu_title' => 'Information',
|
||||||
'icon_url' => 'dashicons-buddicons-activity',
|
'menu_slug' => 'information',
|
||||||
'capability' => 'edit_posts',
|
'capability' => 'edit_posts',
|
||||||
'redirect' => false
|
'redirect' => false
|
||||||
));
|
));
|
||||||
|
|
||||||
acf_add_options_page(array(
|
acf_add_options_sub_page(array(
|
||||||
'page_title' => 'Partenaires',
|
'page_title' => 'Partenaires',
|
||||||
'menu_title' => 'Partenaires',
|
'menu_title' => 'Partenaires',
|
||||||
'icon_url' => 'dashicons-buddicons-activity',
|
'parent_slug' => 'information',
|
||||||
'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.
|
* This ensures that Timber is loaded and available as a PHP class.
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
|
|
||||||
$context = Timber::context();
|
$context = Timber::context();
|
||||||
$context['posts'] = new Timber\PostQuery();
|
$context['posts'] = new Timber\PostQuery();
|
||||||
$context['foo'] = 'bar';
|
|
||||||
$templates = array( 'index.twig' );
|
$templates = array( 'base.twig' );
|
||||||
if ( is_home() ) {
|
if ( is_home() ) {
|
||||||
array_unshift( $templates, 'front-page.twig', 'home.twig' );
|
array_unshift( $templates, 'front-page.twig', 'accueil.twig' );
|
||||||
}
|
}
|
||||||
Timber::render( $templates, $context );
|
Timber::render( $templates, $context );
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
<body class="{{body_class}}" data-template="base.twig">
|
<body class="{{body_class}}" data-template="base.twig">
|
||||||
|
|
||||||
<a class="skip-link screen-reader-text" href="#content">{{ _e( 'Skip to content') }}</a>
|
<a class="skip-link screen-reader-text" href="#content">{{ _e( 'Skip to content') }}</a>
|
||||||
<header class="header">
|
<header class="header">
|
||||||
{% block header %}
|
{% block header %}
|
||||||
|
@ -1 +1,2 @@
|
|||||||
Copyright {{"now"|date('Y')}} by FiguresLibres
|
{{ dump(options) }}
|
||||||
|
<h3>{{ site_options }}</h3>
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
{% extends "base.twig" %}
|
{% extends "base.twig" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h2>{{ foo }}</h2>
|
|
||||||
<p>{{ qux }}</p>
|
|
||||||
{% for post in posts %}
|
{% for post in posts %}
|
||||||
{% include ['tease-'~post.post_type~'.twig', 'tease.twig'] %}
|
{% include ['tease-'~post.post_type~'.twig', 'tease.twig'] %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% include 'temcomponents/buttons/boutton_privatiser.html.twigplate'%}
|
{% include 'components/buttons/boutton_privatiser.html.twig' %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user