View dbtest.php
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 | |
/** | |
* Simple tool for testing MySQL database. | |
* | |
* @package DB_Test | |
* @author Nilambar Sharma <nilambar@outlook.com> | |
* @license GPL-2.0+ | |
* @link http://www.nilambar.net | |
* @copyright 2015 Nilambar Sharma | |
*/ |
View featured.php
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 | |
/** | |
* Template Name: Featured | |
*/ | |
?> | |
<?php | |
$custom_query_args = array( | |
'post_type' => 'post', | |
'meta_key' => '_is_ns_featured_post', | |
'meta_value' => 'yes', |
View transient_example.php
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 example_transient(){ | |
$transient_key = 'my_unique_transient_key'; | |
$transient_period = 24 * HOUR_IN_SECONDS; | |
$output = get_transient( $transient_key ); | |
if ( false === $output ) { | |
$output = 'Hello World'; |
View wordpress_loop.php
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 | |
$custom_query_args = array( | |
'post_type' => 'post', | |
); | |
// Get current page and append to custom query parameters array | |
$custom_query_args['paged'] = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1; | |
$custom_query = new WP_Query( $custom_query_args ); ?> | |
<?php | |
// Pagination fix |