This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| Options All -Indexes |
This file contains hidden or 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
| order allow,deny | |
| deny from 456.123.8.9 | |
| allow from all |
This file contains hidden or 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
| <Files wp-login.php> | |
| order deny,allow | |
| Deny from all | |
| # allow access from my IP address | |
| allow from 192.168.5.1 | |
| </Files> |
This file contains hidden or 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
| order deny,allow | |
| allow from 192.168.5.1 | |
| deny from all |
This file contains hidden or 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
| <files wp-config.php> | |
| order allow,deny | |
| deny from all | |
| </files> |