M
M
Maxim Yakovenko2016-04-16 11:42:36
Twig
Maxim Yakovenko, 2016-04-16 11:42:36

Why does layout slide out when rendering a page in a WordPress plugin?

I am writing a plugin for WordPress, when working out the render method, I specify the file to be connected . Inside the render function, the data is transferred to the Twig template engine
<?php echo $this->render('index.php', []);?>

<?php return $this->_renderer->render($file,$params) ?>

An example index.php file
<div class="wrap">
    <p>Test</p>
    <p>Test</p>
</div>

But, I get the output.
83345fe25bf84140a2054b7107d59a6b
I also tried to directly display the page (without TWIG), but the result is still the same.
After googling, I found results that relate to topics, basically. People write that the problem may be the absence of a closing tag somewhere in the template.
Perhaps I do not quite understand how to display the page correctly. But, how many articles I have not watched (
https://codex.wordpress.org/Writing_a_Plugin#Exter...
www.sitepoint.com/wordpress-plugin-development/,
https://premium.wpmudev.org/blog/wordpress -plugin-... www.hongkiat.com/blog/beginners-guide-to-wordpress...
etc.)
all show that you can just echo and you're done. Where is the catch?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
aarty20, 2016-04-16
@aarty20

inspect the page, it's worth looking at what the html gives there, it may also be possible to find the reason there

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question