예제 #1
0
function fb_opengraph()
{
    global $post;
    $thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'destaque.pequeno');
    $th = !empty($thumb[0]) ? $thumb[0] : '';
    $site_description = get_bloginfo('description');
    $stylesheet_url = get_bloginfo('stylesheet_url');
    $stylesheet_directory = get_bloginfo('stylesheet_directory');
    $site_name = is_home() ? get_bloginfo('name') : get_the_title($post->ID);
    $site_url = is_home() ? get_bloginfo('siteurl') : get_permalink($post->ID);
    $keywords = get_field('pba_keywords', 'option');
    ?>

    <meta name="description" content="<?php 
    echo getPageDescription();
    ?>
">
    <meta name="keywords" content="<?php 
    echo $keywords;
    ?>
">
    <meta name="author" content="http://plandc.com.br">
    <meta name="subject" content="Portal de notícias da Paraíba">

    <title><?php 
    bloginfo('name');
    ?>
 | <?php 
    is_home() ? bloginfo('description') : wp_title('');
    ?>
</title>
    <link rel="shortcut icon" href="<?php 
    echo $stylesheet_directory;
    ?>
/favicon.ico" type="image/vnd.microsoft.icon"/>
    <link rel="icon" href="<?php 
    echo $stylesheet_directory;
    ?>
/favicon.ico" type="image/x-ico"/>
    <link rel="stylesheet" href="<?php 
    echo $stylesheet_url;
    ?>
" />

    <!-- Schema.org markup for Google+ -->
    <meta itemprop="name" content="<?php 
    echo $site_name;
    ?>
">
    <meta itemprop="description" content="<?php 
    echo getPageDescription();
    ?>
">
    <?php 
    if (is_home()) {
        ?>
      <meta itemprop="image" content="<?php 
        echo $stylesheet_directory;
        ?>
/screenshot.png">
    <?php 
    } else {
        ?>
<meta itemprop="image" content="<?php 
        getThumbUrl('full');
        ?>
"><?php 
    }
    ?>

    <!-- Twitter Card data -->
    <?php 
    if (is_home()) {
        ?>
      <meta name="twitter:card" content="<?php 
        echo $stylesheet_directory;
        ?>
/screenshot.png">
    <?php 
    } else {
        ?>
<meta name="twitter:card" content="<?php 
        getThumbUrl('full');
        ?>
"><?php 
    }
    ?>
    <meta name="twitter:site" content="@pbagora">
    <meta name="twitter:title" content="<?php 
    echo $site_name;
    ?>
">
    <meta name="twitter:description" content="<?php 
    echo getPageDescription();
    ?>
">
    <meta name="twitter:creator" content="@plandc">
    <!-- Twitter summary card with large image must be at least 280x150px -->
    <?php 
    if (is_home()) {
        ?>
      <meta name="twitter:image:src" content="<?php 
        echo $stylesheet_directory;
        ?>
/screenshot.png">
    <?php 
    } else {
        ?>
<meta name="twitter:image:src" content="<?php 
        getThumbUrl('full');
        ?>
"><?php 
    }
    ?>

    <!-- Open Graph data -->
    <meta property="og:title" content="<?php 
    echo $site_name;
    ?>
" />
    <meta property="og:type" content="article" />
    <meta property="og:url" content="<?php 
    echo $site_url;
    ?>
" />
    <?php 
    if (is_home()) {
        ?>
      <meta property="og:image" content="<?php 
        echo $stylesheet_directory;
        ?>
/screenshot.png" />
    <?php 
    } else {
        ?>
<meta property="og:image" content="<?php 
        getThumbUrl('full');
        ?>
" /><?php 
    }
    ?>
    <meta property="og:description" content="<?php 
    echo getPageDescription();
    ?>
" />
    <meta property="og:site_name" content="<?php 
    echo $site_name;
    ?>
" />
    
    <?php 
    if (!is_home()) {
        ?>
      <meta property="article:section" content="Artigo" />
      <meta property="article:tag" content="<?php 
        echo $keywords;
        ?>
" />
    <?php 
    }
    ?>
 
<?php 
    echo get_field('pba_analytics', 'option');
}
예제 #2
0
function fb_opengraph()
{
    global $post;
    $thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'destaque.pequeno');
    $th = !empty($thumb[0]) ? $thumb[0] : '';
    $site_description = get_bloginfo('description');
    $stylesheet_url = get_bloginfo('stylesheet_url');
    $stylesheet_directory = get_bloginfo('stylesheet_directory');
    $site_name = is_home() ? get_bloginfo('name') : get_the_title($post->ID);
    $site_url = is_home() ? get_bloginfo('siteurl') : get_permalink($post->ID);
    $keywords = 'produtos, design, desenho industrial';
    ?>

    <meta name="description" content="<?php 
    echo getPageDescription();
    ?>
">
    <meta name="keywords" content="<?php 
    echo $keywords;
    ?>
">
    <meta name="author" content="<?php 
    echo $site_url;
    ?>
">
    <meta name="subject" content="Sérgio J. Matos">

    <!-- Schema.org markup for Google+ -->
    <meta itemprop="name" content="<?php 
    echo $site_name;
    ?>
">
    <meta itemprop="description" content="<?php 
    echo getPageDescription();
    ?>
">
    <?php 
    if (is_home()) {
        ?>
      <meta itemprop="image" content="<?php 
        echo $stylesheet_directory;
        ?>
/screenshot.png">
    <?php 
    } else {
        ?>
<meta itemprop="image" content="<?php 
        getThumbUrl();
        ?>
"><?php 
    }
    ?>

    <!-- Twitter Card data -->
    <?php 
    if (is_home()) {
        ?>
      <meta name="twitter:card" content="<?php 
        echo $stylesheet_directory;
        ?>
/screenshot.png">
    <?php 
    } else {
        ?>
<meta name="twitter:card" content="<?php 
        getThumbUrl();
        ?>
"><?php 
    }
    ?>
    <meta name="twitter:site" content="@sergiojmatos">
    <meta name="twitter:title" content="<?php 
    echo $site_name;
    ?>
">
    <meta name="twitter:description" content="<?php 
    echo getPageDescription();
    ?>
">
    <meta name="twitter:creator" content="@sergiojmatos">
    <!-- Twitter summary card with large image must be at least 280x150px -->
    <?php 
    if (is_home()) {
        ?>
      <meta name="twitter:image:src" content="<?php 
        echo $stylesheet_directory;
        ?>
/screenshot.png">
    <?php 
    } else {
        ?>
<meta name="twitter:image:src" content="<?php 
        getThumbUrl();
        ?>
"><?php 
    }
    ?>

    <!-- Open Graph data -->
    <meta property="og:title" content="<?php 
    echo $site_name;
    ?>
" />
    <meta property="og:type" content="article" />
    <meta property="og:url" content="<?php 
    echo $site_url;
    ?>
" />
    <?php 
    if (is_home()) {
        ?>
      <meta property="og:image" content="<?php 
        echo $stylesheet_directory;
        ?>
/screenshot.png" />
    <?php 
    } else {
        ?>
<meta property="og:image" content="<?php 
        getThumbUrl();
        ?>
" /><?php 
    }
    ?>
    <meta property="og:description" content="<?php 
    echo getPageDescription();
    ?>
" />
    <meta property="og:site_name" content="<?php 
    echo $site_name;
    ?>
" />
    
    <?php 
    if (!is_home()) {
        ?>
      <meta property="article:section" content="Artigo" />
      <meta property="article:tag" content="<?php 
        echo $keywords;
        ?>
" />
    <?php 
    }
    ?>
 
<?php 
    echo get_field('pba_analytics', 'option');
}