This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enable all core updates, including minor and major: | |
define( 'WP_AUTO_UPDATE_CORE', true ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'wp_dashboard_setup', 'register_my_dashboard_widget' ); | |
function register_my_dashboard_widget() { | |
wp_add_dashboard_widget( | |
'my_dashboard_widget', | |
'My Dashboard Widget', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// function to display number of posts. | |
function getPostViews($postID){ | |
$count_key = 'post_views_count'; | |
$count = get_post_meta($postID, $count_key, true); | |
if($count==''){ | |
delete_post_meta($postID, $count_key); | |
add_post_meta($postID, $count_key, '0'); | |
return "0 View"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// extract JetPack pageviews | |
// courtesy of Topher: http://wpgr.org/2013/03/02/rendering-jetpack-stats/ | |
function get_page_views($post_id) { | |
if (function_exists('stats_get_csv')) { | |
$args = array('days'=>-1, 'limit'=>-1, 'post_id'=>$post_id); | |
$result = stats_get_csv('postviews', $args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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 | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doctype_opengraph($output) { | |
return $output . ' | |
xmlns:og="http://opengraphprotocol.org/schema/" | |
xmlns:fb="http://www.facebook.com/2008/fbml"'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fb_opengraph() { | |
global $post; | |
if(is_single()) { | |
if(has_post_thumbnail($post->ID)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function load_plugin_textdomain() { | |
load_plugin_textdomain( 'sample-plugin', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' ); | |
} | |
add_action( 'plugins_loaded', 'load_plugin_textdomain' ); |