meta tag, inserted in html fragment dynamically in body, does it work?

Asked

Viewed 84 times

0

I have a loop loop that inserts <div>'s. Those <div>'s are content with text coming from the database and with the option to share on facebook. By the time I get these div’s I insert some tags <meta> those on facebook, but they stay on the content of <body>. So far they don’t work, but should they work? Or will these tags work if I include them in the tag <head> ?

In my system I can share correctly in some places, but I insert the contents of the tags by the controller there yes, go to the <head> and they work, but in that moment those texts were in .collapse's and will have several others on the same page.

foreach ($ordemdia as $key => $ordem) {
 return "<meta property='og:image' content='/upload/itens/images/thumbs/{$ordem['tbvereadores']['img']}'>
.<div class='col-md-12'>...#conteudo...</div>";

}

inserir a descrição da imagem aqui

  • These goals need to stay in the <head> and they are unique per page because they store the parameters og page in question, not a div.

  • exact, that’s what I thought. Thank you for the reply.

No answers

Browser other questions tagged

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