0
I have an old site, all done in html, with thousands of pages to edit. All news pages, are with the same title
<title>Prefeitura Municipal...</title>
And at the time I didn’t enter the meta tags that Facebook reads. I would then like to insert this code below on all pages
<meta property="og:title" content="">
and that within the "content" was the very headline of the news. I have a title div, example:
<span id="titulo">Título da notícia</span>
I would like to "take" this content from within this div and replicate it within "content". In an automatic way, that worked in all thousands of news.
Detail, all pages are in . html, if they were in . php could be simpler to solve this, but I can’t change it to .php. I tried to change the title via javascript, as shown below. And it changes right, but Facebook does not recognize this change, and it continues to maintain what is in the code.
document.title = $('#titulo').html()
Facebook will not take the value of an element changed via Javascript. It takes the return from the server. Javascript runs in the browser. I believe you will have to arrange an automatic way to change the files, since there are many and doing it manually would be impractical.
– Sam
@Sam This, I’m trying to find an automatic way, I can automatically insert the same code in all via Dreamweaver, but entering the title manually in each one would be impossible even.
– Camila
Maybe with a PHP application you can rewrite each file by inserting the tag with the respective title.
– Sam