Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timber::get_post do not work after updating WP from 5.8.5 to 6.11 #2693

Closed
taurus-git opened this issue Dec 26, 2022 · 5 comments
Closed

Timber::get_post do not work after updating WP from 5.8.5 to 6.11 #2693

taurus-git opened this issue Dec 26, 2022 · 5 comments
Labels
needs-info Need more info on this issue in order to properly investigate

Comments

@taurus-git
Copy link

taurus-git commented Dec 26, 2022

After updating WP from 5.8.5 to 6.1.1
Timber::get_post and Timber::get_posts return null on posts, categories, and tags.

Expected behavior

return non empty WP_Query with actual post / taxonomy

Actual behavior

global $wp_query; also returns null

object(WP_Query)[7856]
  public 'query' => null
  ...

get_the_ID() return false or 0

Steps to reproduce behavior

just update WP from 5.8.5 to 6.1.1

What version of WordPress, PHP, and Timber are you using?

Example: WordPress 6.1.1, PHP 7.4, Timber 1.3.4

How did you install Timber? (for example, from GitHub, Composer/Packagist, WP.org?)

Timber installed as a lib inside the project

@taurus-git
Copy link
Author

taurus-git commented Dec 26, 2022

single.php
$template = 'single.twig';

$context         = \Timber\Timber::get_context();
$context['post'] = \Timber\Timber::get_post( false, '\Entities\Story_Post' ); //here returns false

\Timber\Timber::render( $template, $context );

@gchtr
Copy link
Member

gchtr commented Dec 29, 2022

Is there a reason why you’re still on Timber 1.3.4? The most current stable version is actually 1.22.1. I suggest you first update Timber and see if that solves the issue.

@gchtr gchtr added the needs-info Need more info on this issue in order to properly investigate label Dec 29, 2022
@taurus-git
Copy link
Author

Thanks a lot I will try.
Any ideas on how to update the theme inside my site?)
image

Is there a reason why you’re still on Timber 1.3.4? The most current stable version is actually 1.22.1. I suggest you first update Timber and see if that solves the issue.

@rmens
Copy link
Contributor

rmens commented Dec 29, 2022

Oof. Your theme seems to ship a lot of dependencies that probably don't get updated. You should ask your theme vendor to update all the dependencies first.

It that doesn't work, check out what's in the 'lib' and 'vendor' folders and see if the same files are in the latest release of Timber.

@Levdbas
Copy link
Member

Levdbas commented Mar 3, 2023

Seems to be stale and is based on a very old issue. Can be closed in my opinion.

@Levdbas Levdbas closed this as not planned Won't fix, can't repro, duplicate, stale May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-info Need more info on this issue in order to properly investigate
Projects
None yet
Development

No branches or pull requests

4 participants