I'm trying to insert a include_once inseide a echo do_shortcode and my line is this:
<?php $activar = get_option("activar-pelicula"); ?>
<?php
if ($activar == "true") {
echo do_shortcode('[to_like]' .include_once "includes/single/player.php"; . '[/to_like]');
} ?>
this is the error I'm getting:
Warning: include_once(includes/single/player.php[/to_like]): failed to open stream: No such file or directory in /home/novosfil/public_html/wp-content/themes/grifus/single.php on line 8
Warning: include_once(): Failed opening 'includes/single/player.php[/to_like]' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/novosfil/public_html/wp-content/themes/grifus/single.php on line 8
I'm trying to get this line (original line)
<?php
$activar = get_option("activar-pelicula");
if ($activar == "true") {
include_once "includes/single/player.php";
} ?>
inside the locker with this
<?php
echo do_shortcode('[to_like]' HER GOES THAT PART OF THE PAGE '[/to_like]');
} ?>
ok that's it.
include_once
works. It does not return a string, it executes PHP code. You need a different approach. What is inplayer.php
? – Alexander O'Mara