Created
September 17, 2017 13:11
-
-
Save mostafasoufi/6925a48beb8ade3d27d42d15d35392ca to your computer and use it in GitHub Desktop.
How get pages stat list with page slug
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 | |
global $wpdb, $table_prefix; | |
$page_slug = '%about%'; | |
$pages = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `{$table_prefix}statistics_pages` WHERE `uri` LIKE %s", $page_slug ) ); | |
echo '<table border="1"><tr><td>ID</td><td>Count</td><td>Slug</td></tr>'; | |
foreach ( $pages as $page ) { | |
echo "<tr><td>{$page->id}</td><td>{$page->count}</td><td>{$page->uri}</td></tr>"; | |
} | |
echo '</table>'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment