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 | |
$apiKey=array('dc394775', 'dc394775'); | |
$random_keys=array_rand($apiKey); | |
$keys = 'tt3766394,tt0064418,tt2378794'; | |
$key = explode(',', $keys); | |
foreach($key as $key) | |
{ | |
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 | |
// PHP program to delete all | |
// file from a folder | |
// Folder path to be flushed | |
$folder_path = "file"; | |
// List of name of files inside | |
// specified folder | |
$files = glob($folder_path.'/*'); |
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 | |
$url = $_SERVER["SCRIPT_NAME"]; | |
$page = $_GET['page'] ='' ? '' : $_GET['page']; | |
$search = $_GET['s'] ='' ? '' : $_GET['s']; | |
$search = str_replace(' ', '', $search).''.$page; | |
$break = Explode('/', $url); | |
$file = $break[count($break) - 1]; | |
$cachefile = 'cache/cached-'.$search.'-'.substr_replace($file ,"",-4).'.html'; | |
$cachetime = 18000; |
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 | |
$a=array("red","green","blue","yellow","brown"); | |
$random_keys=array_rand($a); | |
echo $a[$random_keys]; | |
if (isset($_GET['page'])) { | |
$pageno = $_GET['page']; | |
} else { |
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 | |
// Example for custom pagination in php | |
$total_rows = 554; | |
$no_of_records_per_page = 10; | |
$total_pages = ceil($total_rows / $no_of_records_per_page); | |
$url = "https://gist.github.com/" |
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
function tp_stop_guestes( $content ) { | |
global $post; | |
if ( $post->post_type == 'post' ) { | |
if ( !is_user_logged_in() ) { | |
$content = 'Please login to view this post'; | |
wp_redirect(get_the_permalink(5)); | |
} | |
} |
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
/************** Woocommerce product listing without pagination ************************/ | |
add_action( 'pre_get_posts', 'custom_pre_get_posts' ); | |
function custom_pre_get_posts($query) { | |
if ( is_woocommerce() ) { | |
$query->set('posts_per_page', -1); | |
} | |
return $query; | |
} |
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
function get_time_zone() { | |
$ip = $_SERVER['REMOTE_ADDR']; | |
$ch = curl_init(); | |
$curlConfig = array( | |
CURLOPT_URL => "http://www.geoplugin.net/json.gp?ip=".$ip, | |
CURLOPT_POST => true, | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_POSTFIELDS => false |
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
/************************proxy custom links *******************************/ | |
function proxy_name() { | |
$port = ""; | |
$type = ""; | |
$ssl = ""; | |
$country = ""; | |
$latency = ""; | |
$reliability = ""; | |
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 | |
/** | |
* Template Name: Load more | |
* | |
* This is the template that displays all pages by default. | |
* Please note that this is the WordPress construct of pages and that | |
* other "pages" on your WordPress site will use a different template. | |
* | |
* @package WordPress | |
* @subpackage Twenty_Fifteen |