unable to access the functions.php #555
-
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
@rajpatel2435 at the moment I don't understand what you are trying to achieve, but from the screenshots I see that you are using .php files within the templates folder and I would strongly recommend not doing this. Can you please describe in more detail what exactly you want to do? |
Beta Was this translation helpful? Give feedback.
-
Hey @timohubois @aaronmeder I want to use the WordPress template functionality where I have template file in php format and I have some predefined functions in php file. what is the template hierarchy for Flynt. what if we want use defined function with php? Do we need component for that? |
Beta Was this translation helpful? Give feedback.
-
@rajpatel2435 it's not fully understandable to me what your goal would be. A big part of what makes Flynt is the included Timber, which comes with Twig as included templating language. So I think in most cases you would not want to use the traditional php template files (nor If what you want however is to define some global helper functions that can be used everywhere, for example in your Component's functions.php then have a look at the use Flynt\Utils\StringHelpers;
add_filter('Flynt/addComponentData?name=BlockWysiwyg', function ($data, $componentName) {
$data['someText'] = StringHelpers::camelCaseToKebab('howToTurnACamelIntoASnake');
return $data;
}, 10, 2); In that Component's twig template (Components/BlockWysiwyg/index.twig) you can output that using Did that answer some of your questions? Happy weekend! |
Beta Was this translation helpful? Give feedback.
-
Got that! Thank you so much for your response. As Flynt provides a speed score of 100, I am building my WordPress theme with the help of Flynt. However, I am currently experiencing a performance issue where the mobile score is around 57, primarily due to Total Blocking Time (TBT). Could you assist me in improving this? I would appreciate any insights into where I might be going wrong. Here is the site: Baltimore Ravens Thanks, |
Beta Was this translation helpful? Give feedback.
-
Thank you for your answer. Regarding that, I enabled the component based structure in order to load the template with rewrite rule. Thanks |
Beta Was this translation helpful? Give feedback.
Hi @timohubois @aaronmeder
Thank you for your answer.
Regarding that, I enabled the component based structure in order to load the template with rewrite rule.
Thanks