Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- Meta Dane i Meta Opisy Open Graph Dla FB - Gotowy Kod Dla WordPressa -- manualnie -->
- <?php if (is_home()) { ?>
- <!-- if page is home -->
- <meta property="og:title" content="<?php bloginfo('name'); ?>" />
- <meta property="og:description" content="<?php bloginfo('description'); ?>" />
- <meta property="og:site_name" content="<?php bloginfo('name'); ?>">
- <meta property="og:url" content="<?php bloginfo('url'); ?>"/>
- <meta property="og:type" content="website" />
- <meta property="og:image" content="<?php echo get_template_directory_uri(); ?>/images/supermen-wordpress.png" />
- <meta property="og:locale" content="pl_pl">
- <?php } if (is_single()) { ?>
- <!-- if page is content page -->
- <meta property="og:title" content="<?php single_post_title(''); ?>" />
- <meta property="og:description" content="<?php
- $description = get_post($post->ID);
- $description = $description->post_content;
- $trimmed = wp_trim_words( $description, $num_words = 55, $more = null );
- echo $trimmed; ?>" />
- <meta property="og:site_name" content="<?php bloginfo('name'); ?>">
- <meta property="og:url" content="<?php the_permalink() ?>"/>
- <meta property="og:type" content="article" />
- <meta property="og:image" content="<?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full');
- $url = $thumb['0'];
- echo $url;?>" />
- <meta property="og:locale" content="pl_pl">
- <?php } if (is_page()){ ?>
- <!-- if page is others -->
- <meta property="og:title" content="<?php wp_title(); ?>" />
- <meta property="og:description" content="<?php echo get_post_meta($post->ID, "description", true); ?> | <?php bloginfo('description'); ?>" />
- <meta property="og:site_name" content="<?php bloginfo('url'); ?>" />
- <meta property="og:url" content="<?php the_permalink() ?>"/>
- <meta property="og:type" content="website" />
- <meta property="og:image" content="<?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full');
- $url = $thumb['0'];
- echo $url;?>" />
- <meta property="og:locale" content="pl_pl">
- <?php } ?>
- <!-- End of Open Graph -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement