{"action":"created","issue":{"url":"https://api.github.com/repos/timber/timber/issues/1217","repository_url":"https://api.github.com/repos/timber/timber","labels_url":"https://api.github.com/repos/timber/timber/issues/1217/labels{/name}","comments_url":"https://api.github.com/repos/timber/timber/issues/1217/comments","events_url":"https://api.github.com/repos/timber/timber/issues/1217/events","html_url":"https://github.com/timber/timber/issues/1217","id":184095772,"number":1217,"title":"ACF repeater rows, footer, and admin bar missing from page","user":{"login":"mikehwagz","id":12376535,"avatar_url":"https://avatars.githubusercontent.com/u/12376535?v=3","gravatar_id":"","url":"https://api.github.com/users/mikehwagz","html_url":"https://github.com/mikehwagz","followers_url":"https://api.github.com/users/mikehwagz/followers","following_url":"https://api.github.com/users/mikehwagz/following{/other_user}","gists_url":"https://api.github.com/users/mikehwagz/gists{/gist_id}","starred_url":"https://api.github.com/users/mikehwagz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikehwagz/subscriptions","organizations_url":"https://api.github.com/users/mikehwagz/orgs","repos_url":"https://api.github.com/users/mikehwagz/repos","events_url":"https://api.github.com/users/mikehwagz/events{/privacy}","received_events_url":"https://api.github.com/users/mikehwagz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-19T23:01:13Z","updated_at":"2016-10-20T18:19:21Z","closed_at":null,"body":"### Expected behavior\r\nSlowly, one page/ui component at a time, I am using Timber to rebuild a university political review site. First page to rebuild was the team page. I started by making a local copy of the site and creating a child of the current theme (Bucket by PixelGrade). Using an ACF Repeater (a row for each team member), I effortlessly created a beautiful team page whilst sipping coffee from my Timber coffee mug (Thanks Upstatement!!!). The entire page looks and functions as it should locally.\r\n\r\n### Actual behavior\r\nAfter deploying the new child theme, exporting and importing the Repeater field group, and manually inputting the content, the page does not display correctly. Details, screenshots, and code below:\r\n\r\nWith Timber 1.1.7.1 the following components are missing:\r\n- wp admin bar\r\n- site navigation dropdowns do not expand on hover as expected\r\n- page content \r\n- footer\r\n\r\n![Image of the page with Timber 1.1.7.1]\r\n(http://i.imgur.com/e0lSnnZ.png)\r\n\r\nDowngrading to Timber 0.22.6, I had a bit better luck, but still no dice. The following was still missing:\r\n- wp admin bar\r\n- site navigation dropdowns do not expand on hover as expected\r\n- footer\r\n- the last 2.5 team members (the .5 is a missing bio... see screenshot below)\r\n\r\n![Image of the page with Timber 0.22.6]\r\n(http://i.imgur.com/aq5jZR6.jpg)\r\n\r\n\r\nCode below:\r\n [Review code in the repo if you prefer](https://github.com/mikehwagz/nupr)\r\n\r\n**functions.php** - I copied most of this code from the Timber Starter Theme.\r\n```\r\n<?php\r\n\r\nif ( ! class_exists( 'Timber' ) ) {\r\n\tadd_action( 'admin_notices', function() {\r\n\t\t\techo '<div class=\"error\"><p>Timber not activated. Make sure you activate the plugin in <a href=\"' . esc_url( admin_url( 'plugins.php#timber' ) ) . '\">' . esc_url( admin_url( 'plugins.php' ) ) . '</a></p></div>';\r\n\t\t} );\r\n\treturn;\r\n}\r\n\r\nTimber::$dirname = array('templates', 'views');\r\n\r\nclass BucketChild extends TimberSite {\r\n\r\n\tfunction __construct() {\r\n\t\tadd_theme_support( 'post-formats' );\r\n\t\tadd_theme_support( 'post-thumbnails' );\r\n\t\tadd_theme_support( 'menus' );\r\n\t\tadd_filter( 'timber_context', array( $this, 'add_to_context' ) );\r\n\t\tadd_filter( 'get_twig', array( $this, 'add_to_twig' ) );\r\n\t\tadd_action( 'init', array( $this, 'register_post_types' ) );\r\n\t\tadd_action( 'init', array( $this, 'register_taxonomies' ) );\r\n\t\tparent::__construct();\r\n\t}\r\n\r\n\tfunction register_post_types() {\r\n\t\t//this is where you can register custom post types\r\n\t}\r\n\r\n\tfunction register_taxonomies() {\r\n\t\t//this is where you can register custom taxonomies\r\n\t}\r\n\r\n\tfunction add_to_context( $context ) {\r\n\t\t$context['foo'] = 'bar';\r\n\t\t$context['stuff'] = 'I am a value set in your functions.php file';\r\n\t\t$context['notes'] = 'These values are available everytime you call Timber::get_context();';\r\n\t\t$context['menu'] = new TimberMenu();\r\n\t\t$context['site'] = $this;\r\n\t\treturn $context;\r\n\t}\r\n\r\n\tfunction myfoo( $text ) {\r\n\t\t$text .= ' bar!';\r\n\t\treturn $text;\r\n\t}\r\n\r\n\tfunction add_to_twig( $twig ) {\r\n\t\t/* this is where you can add your own fuctions to twig */\r\n\t\t$twig->addExtension( new Twig_Extension_StringLoader() );\r\n\t\t$twig->addFilter('myfoo', new Twig_SimpleFilter('myfoo', array($this, 'myfoo')));\r\n\t\treturn $twig;\r\n\t}\r\n\r\n}\r\n\r\nnew BucketChild();\r\n\r\n// enqueue styles for child theme\r\nfunction nupr_enqueue_styles() {\r\n\t\r\n\t// enqueue parent styles\r\n\twp_enqueue_style('parent-theme', get_template_directory_uri() .'/style.css');\r\n\t\r\n\t// enqueue child styles\r\n\twp_enqueue_style('child-theme', get_stylesheet_directory_uri() .'/style.css', array('parent-theme'));\r\n\t\r\n}\r\nadd_action('wp_enqueue_scripts', 'nupr_enqueue_styles');\r\n```\r\n\r\n\r\n\r\n**page-3117.php** - Copied the page.php template from the parent theme, and replaced the contents of the container div with the Timber logic.\r\n```\r\n<?php\r\n\r\nget_header(); ?>\r\n\r\n\t<div class=\"container container--main\">\r\n\r\n\t\t<?php\r\n\r\n\t\t\t$context = Timber::get_context();\r\n\t\t\t$context['post'] = new TimberPost();\r\n\t\t\tTimber::render('team.twig', $context);\r\n\r\n\t\t?>\r\n\r\n\t</div>\r\n\r\n<?php\r\nget_footer(); ?>\r\n```\r\n\r\n\r\n\r\n**team.twig** - And finally, the twig template which lives in a templates directory. There is a bit of conditional logic inside the repeater loop, which worked perfectly in my local environment.\r\n```\r\n<h2 class=\"page__title\">{{post.title}}</h2>\r\n\r\n<section class=\"team\">\r\n\r\n\t{% for member in post.get_field('team_members') %}\r\n\t  <div class=\"team-member\">\r\n\t\t\t<div class=\"team-member__image\">\r\n\t\t\t\t{% if member.bg_zoom %}\r\n    \t\t\t<img class=\"team-member__background\" src=\"{{TimberImage(member.background).src}}\" />\r\n\t\t\t\t{% endif %}\r\n    \t\t<img class=\"team-member__headshot\" src=\"{{TimberImage(member.headshot).src}}\" alt=\"{{member.name}}\" />\r\n    \t</div>\r\n    \t<div class=\"team-member__body\">\r\n\t\t    <header class=\"team-member__header\">\r\n\t\t    \t<span class=\"team-member__position\">{{member.position}}</span>\r\n\t\t    \t<h4 class=\"team-member__name\">{{member.name}}</h4>\r\n\t\t    </header>\r\n\t\t    <p class=\"team-member__bio\">{{member.bio}}</p>\r\n\t\t  </div>\r\n\t  </div>\r\n\t{% endfor %}\r\n\r\n</section>\r\n```\r\n\r\n\r\n\r\n### Steps to reproduce behavior\r\nI have not been able to reproduce the issue locally. As mentioned above, downgrading to 0.22.6 helped slightly, but still not looking perfect as it did locally.\r\n\r\n### What version of WordPress, PHP and Timber are you using?\r\nSame for local and live:\r\nWordPress 4.6.1\r\nPHP 5.5\r\nTimber 1.1.7.1 (and 0.22.6 for testing purposes as mentioned above. has no effect on appearance of page locally)\r\n\r\n### How did you install Timber? (for example, from GitHub, Composer/Packagist, WP.org?)\r\nWP.org\r\n"},"comment":{"url":"https://api.github.com/repos/timber/timber/issues/comments/255186310","html_url":"https://github.com/timber/timber/issues/1217#issuecomment-255186310","issue_url":"https://api.github.com/repos/timber/timber/issues/1217","id":255186310,"user":{"login":"mikehwagz","id":12376535,"avatar_url":"https://avatars.githubusercontent.com/u/12376535?v=3","gravatar_id":"","url":"https://api.github.com/users/mikehwagz","html_url":"https://github.com/mikehwagz","followers_url":"https://api.github.com/users/mikehwagz/followers","following_url":"https://api.github.com/users/mikehwagz/following{/other_user}","gists_url":"https://api.github.com/users/mikehwagz/gists{/gist_id}","starred_url":"https://api.github.com/users/mikehwagz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikehwagz/subscriptions","organizations_url":"https://api.github.com/users/mikehwagz/orgs","repos_url":"https://api.github.com/users/mikehwagz/repos","events_url":"https://api.github.com/users/mikehwagz/events{/privacy}","received_events_url":"https://api.github.com/users/mikehwagz/received_events","type":"User","site_admin":false},"created_at":"2016-10-20T18:19:21Z","updated_at":"2016-10-20T18:19:21Z","body":"@halian-vilela Thanks for the response. I will try to match the solution from the Timber Starter Theme and let you know if that helps.\r\n\r\nRegarding your edit, the repo you are looking at is a child theme, so the header.php and footer.php templates are located in the parent theme."}}
{"actor":{"display_login":"mikehwagz"}}