Failure to put include on site with wordpress

Asked

Viewed 47 times

-1

I have the address of a web radio and I would like it to work on the Wordpress site. I put the code below in my header.php and this radio should appear as navbar at the top of the entire site.

<!-- Rádio Web -->
<?php include 'https://player.maxcast.com.br/comunidadedomdedeus';
?>
<!-- Rádio Web -->

Error print below:
https://imgur.com/a/zYzZYTK

  • But it’s just a link that works as a navbar, which is why I used include. I don’t have the whole navbar code. Of course I can get the source code but the result is the same.

  • Yes, it is a navbar within a full page structure, with html tags, head, body, scripts etc...

  • What is the suggestion? iframe?

  • An iframe can be a good output and work.

  • I had already tried with iframe but it was not very good. I will try again.

  • I got it, @Sam. ?

  • 1

    I will formulate. Success!

Show 2 more comments

1 answer

1


The problem is that the origin of include is a full page and has scripts that will only work on the page itself. A include should be a page with only the required code and already rendered.

You can use an iframe, which will display the page independently:

<iframe src="https://player.maxcast.com.br/comunidadedomdedeus"></iframe>

In CSS you can define iframe properties such as width, height and border:

iframe{
   border: none;
   width: 100%;
   height: 60px;
}

Testing:

iframe{
   border: none;
   width: 100%;
   height: 60px;
}
<iframe src="https://player.maxcast.com.br/comunidadedomdedeus"></iframe>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.