Skip to content

Instantly share code, notes, and snippets.

@digitalinkwell
digitalinkwell / postviewentrymeta.php
Created February 24, 2016 22:35
Post View Entry Meta
<div class="entry-meta">
<?php twentythirteen_entry_meta(); ?>
<?php
// adding page views after Meta Information
$post_id = get_the_ID();
$pageviews = get_page_views($post_id);
echo "$pageviews Views.";
// end of views
?>
function doctype_opengraph($output) {
return $output . '
xmlns:og="http://opengraphprotocol.org/schema/"
xmlns:fb="http://www.facebook.com/2008/fbml"';
}
function fb_opengraph() {
global $post;
if(is_single()) {
if(has_post_thumbnail($post->ID)) {
<meta property="og:title" content="<?php echo the_title(); ?>"/>
<meta property="og:description" content="<?php echo $excerpt; ?>"/>
<meta property="og:type" content="article"/>
<meta property="og:url" content="<?php echo the_permalink(); ?>"/>
<meta property="og:site_name" content="<?php echo get_bloginfo(); ?>"/>
<?php
/*
Plugin Name: Sample Plugin
Plugin URI: http://samplepluginsite.com
Description: Sample plugin that's ready for translation
Author: John Doe
Version: 1.0
Author URI: http://johndoe.com
Text Domain: sample-plugin
Domain Path: /languages/
<?php
function load_plugin_textdomain() {
load_plugin_textdomain( 'sample-plugin', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );
}
add_action( 'plugins_loaded', 'load_plugin_textdomain' );
<?php
printf(
__( 'Your color is %s.', 'sample-plugin' ),
$color
);
<div class="site-info">
<a href="http://wordpress.org/" >< ?php _e( 'Proudly powered by WordPress.', 'sample-plugin' ); ?></a>
</div>
printf(
_n(
'One comment',
'%s comments',
get_comments_number(),
'sample-plugin'
),
number_format_i18n( get_comments_number() )
);