Questions tagged [timber]

Timber is a WordPress plugin to develop themes using the Twig template language

518 questions
11
votes
2 answers

Template isn't being rendered

I am developing a WordPress website using a minimalist JavaScript framework + Timber. I have noticed that between pages, there is about 1500ms delay. I wanted to use W3 Total Cache, or WP Super Cache to see if I can use the cache features so it can…
anon
  • 594
  • 6
  • 25
11
votes
1 answer

WordPress Timber getting posts of a custom post type

I'm just digging into WordPress plus Timber and I came upon a problem that I can't resolve. I have created a custom post type called "project", within which I created a custom field called "project_category". That custom field contains a checkbox of…
filnug
  • 191
  • 1
  • 2
  • 13
8
votes
1 answer

Setting a custom place holder image in twig/timber theme

So I am having a twig/timber issue where I have a difficult time getting a placeimage set, here is what I have so far: {% set defaultimg = site.theme.link ~ '/images/placeimage.png' %} and then later in my code I have:
ShrockCo
  • 357
  • 1
  • 13
8
votes
1 answer

PHP 7.4 trimming whitespace between string variables

I'm running into an issue where when I have multiple variables being output into a class attribute, they all get compressed into a single word rather than kept as separate words as originally authored, as in
Luis Martins
  • 1,421
  • 2
  • 18
  • 32
8
votes
1 answer

How can I change the "Read More" text for a post preview when using post.preview instead of post.get_preview in Timber?

Before Timber version 1.3.1, if you wanted to change the Read More text for a post preview, you could use {{ post.get_preview(50, 'false', 'Keep Reading') }}. This function has been deprecated and it is recommended to use {{ post.preview }}, but it…
Wes Cole
  • 128
  • 2
  • 6
7
votes
3 answers

Timber logs are not being shown in Android Studio Dolphin 2021.3.1

Timber logs are not visible in Android Studio Dolphin 2021.3.1 Log Statements Timber.d("onCreateViewCalled using Timber") Log.d("Login", "onCreateViewCalled using Log") OUTPUT Only the Log library logs are visible and not the Timber ones.
7
votes
2 answers

Timber (Twig) how to call wordpress functions

In Timber is this function {{post}} where you get things like {{post.post_title}} but there are other functions in WordPress like get_the_permalink(); which are not accessible from post.get_the_permalink or post.get_permalink these are the…
Noel Schenk
  • 724
  • 1
  • 8
  • 19
6
votes
0 answers

Timber Twig Get post_tag with out joining

I'm trying to output my post_tags for a post and using the example from the Timber docs. It works as expected but I'm trying to show each tag as a button. I'm sure it's probably seemingly simple. I just cannot figure it out. Right now both tags…
lnickel
  • 331
  • 1
  • 6
  • 17
6
votes
1 answer

Get Template Directory Timber/Twig

I have a setup a simple twig template which is used to display a simple menu. I have images in here that are static and I would like use the template directory path for the image src. However when I use {{theme.link}} it appears blank. Perhaps I'm…
verdond2
  • 97
  • 1
  • 4
6
votes
1 answer

Custom archive page with Timber RSS Feed Issue

I've built a custom archive page within Wordpress using Timber and the Route method. The page works well and shows a combination of Custom Post Types but the feed at {url}/feed doesn't exist. note: Previous answer has been edited to remove confusing…
sidonaldson
  • 24,431
  • 10
  • 56
  • 61
5
votes
2 answers

Escaping requirements for Twig / Timber within WordPress

I'm using the Twig templating system as well as the Timber plugin within WordPress and one thing the Timber pages say about escaping is that: By default, Timber does not escape the output of standard tags (i.e. {{ post.field }}). If you want to…
Brett
  • 19,449
  • 54
  • 157
  • 290
5
votes
1 answer

Twig_Error_Syntax for "Unknown filter" with a Twig filter in Timber

This has got to be simple, but I can't see what's wrong. I'm using the simple filter example at https://twig.symfony.com/doc/1.x/advanced.html#filters with Twig 1.34 in Timber, a WordPress plugin. I added // an anonymous function $filter = new…
BlueDogRanch
  • 721
  • 1
  • 16
  • 43
5
votes
1 answer

Timber Twig and ACF Get image from custom field on taxonomy page

Just like the title, I'm trying to get an image from a custom field I attached to a taxonomy. I currently have a taxonomy called city and the term would be some like Albuquerque, NM. I have created an image custom field ('city_hero_image') with…
lnickel
  • 331
  • 1
  • 6
  • 17
5
votes
2 answers

Timber & WPML string translation

Hi I'm using Timber and what it used to be as simple as _e('string', 'theme') to translate strings with WPML, seems to not been working on Timber any idea on how to translate strings? I have tried the following and nothing is working {{…
Mario Sanchez Maselli
  • 1,021
  • 1
  • 12
  • 25
4
votes
2 answers

Use different template for children categories

I have a parent category page in WordPress that displays a single post and four sub categories below it. The four sub category pages will share the same HTML and logic, but are different from the parent category. The parent category is using…
Mike Hermary
  • 346
  • 7
  • 22
1
2 3
34 35