Remember, there are 'TWIG' tools and then there are 'Timber' tools.
The second is WordPress specific.
if ( function_exists( 'acf_add_options_page' ) ) { | |
/** | |
* Example: Single 'Theme Settings' page, with children | |
* | |
* These only create the pages, which must be then populated via custom ACF fields. | |
* This setup creates a 'parent' ACF config page and sub-pages. | |
*/ | |
acf_add_options_page( | |
array( | |
'page_title' => 'Theme General Settings', |
This is a comparison of a default 'WordPress' template and the same template re-written to instead use Timber/TWIG to separate the coding from the theming.
Example Code:
This is for a custom-post type named 'Books' and the template-file is correctly named archive-books.php
.
<?php | |
/** | |
* Note: If using Timber, a generated anchor is avaiable via {{ block.id }} | |
* This approach requires creating a custom 'anchor_id' field and/or using PHP to custom-generate one. | |
*/ | |
$anchor_id = get_sub_field( 'anchor_id' ); | |
?> | |
Depending on the scenario, there are a number of 'templates' that could make work a little easier if previously templated.
Creating tasks, creating large feature requests, commenting on changes to insurance
updates, and so on.
The linked / associated gists provide an initial draft of example templates, which can hopefully be built upon.
function custom_columns( $columns ) { | |
$columns = array( | |
'cb' => '<input type="checkbox" />', | |
'featured_image' => 'Image', | |
'title' => 'Title', | |
'comments' => '<span class="vers"><div title="Comments" class="comment-grey-bubble"></div></span>', | |
'date' => 'Date' | |
); | |
return $columns; | |
} |