Issue in Routers.php file after updating to 6.0 WP version and Timber Plugin
-
There is an issue in Routers.php file after updating to 6.0 WP version and Timber Plugin.
Using the “\Routes::map()” and “\Routes::load” function in routers.php.
But not getting post’s data in the “account_controller”, tried using “\Timber::query_post()” and “new \Timber\Post()” functions to fetch post’s data but both of them are not working.
Can you please help me to solve this issue?
Routers.php code:
\Routes::map('/profile',function($params){ $query = sprintf('posts_per_page=1&post_status=publish&post_type=%s&name=%s','page','profile'); $params['action'] = 'viewUserProfileAction'; $params['controller'] = 'account_controller'; \Routes::load(self::HANDLER, $params, $query, 200); });
account_controller.php code:
$p = \Timber::query_post(); //new \Timber\Post();
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Issue in Routers.php file after updating to 6.0 WP version and Timber Plugin’ is closed to new replies.