• User Attivo

    Vuoi sapere come procedere per creare questi "collegamenti" ?


  • User Attivo

    Allora, ecco qui:

    prima di tutto va creato il file .php dal quale verranno richiamati i tags, che chiameremo ad esempio meta-tags.php

    il suo contenuto sarà questo (in teoria le aperture e chiusure dei tag php non servono nemmeno):

    [PHP]

    <?php
    ?>
    <meta property="og:title" content="...">
    <meta property="og:type" content="...">
    <meta property="og:url" content="...">
    <meta property="og:image" content="...">
    <?php
    ?>

    [/PHP]

    Nella pagina dove dovranno essere inseriti è necessario effettuare un include del file meta-tags in questo modo:

    [PHP]

    <? include 'meta-tags.php'; ?>

    [/PHP]

    Questo lo vai a mettere nel luogo esatto dove vuoi che i meta-tags appaiano


  • User Attivo
    • og:title - The title of your object as it should appear within the graph, e.g., "The Rock".
    • og:type - The type of your object, e.g., "video.movie". Depending on the type you specify, other properties may also be required.
    • og:image - An image URL which should represent your object within the graph.
    • og:url - The canonical URL of your object that will be used as its permanent ID in the graph

  • User Attivo

    Che CMS usi?


  • ModSenior

    Ciao,
    ti basta mettere l'echo di alcune variabili, a cui darai il valore nella pagina principale.

    Esempio:

    Pagina a.php

    
    $var1 = 'Valore da dare';
    include('metatag.php');
    
    

    Pagina b.php

    
    $var1 = 'Valore da dare nella pagina B';
    include('metatag.php');
    
    

    metatag.php

    
    <meta property="og:title" content="<?php if(isset($var1)) echo $var1; ?>">     
    <meta property="og:type" content="...">
    <meta property="og:(http://www.giorgiotave.it/wikigt/os/URL)" content="...">
    <meta property="og:image" content="...">
    
    

    Ovviamente devi farlo per ogni tag, l'ho semplificato per renderlo facilmente comprensibile.