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: Foo Single | |
* Plugin URI: https://example.com | |
* Description: Custom plugin. | |
* Version: 1.0.0 | |
* Author: Nilambar Sharma | |
* Author URI: https://asdf.com | |
* License: GPL-2.0+ | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
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 | |
*/ |
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', |
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'; |
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 |