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 | |
/** | |
* According to the lhrec_106's answer at StackOverflow | |
* http://stackoverflow.com/a/17339542/1743124 | |
*/ | |
$jQueryLatestURI = "http://code.jquery.com/jquery-latest.min.js"; | |
@$connection = fopen( $jQueryLatestURI, "r" ); |
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 | |
/* Assisted by Mr. Ariful Haque */ | |
$ch = curl_init(); | |
curl_setopt( $ch, CURLOPT_URL, 'http://www.oilprice.com'); | |
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true); | |
$content = curl_exec($ch); | |
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 | |
/** | |
* Tests if any of a post's assigned categories are descendants of target categories | |
* | |
* @param int|array $cats The target categories. Integer ID or array of integer IDs | |
* @param int|object $_post The post. Omit to test the current post in the Loop or main query | |
* @return bool True if at least 1 of the post's categories is a descendant of any of the target categories | |
* @see get_term_by() You can get a category by name or slug, then pass ID to this function | |
* @uses get_term_children() Passes $cats | |
* @uses in_category() Passes $_post (can be empty) |
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
function new_subcategory_hierarchy() { | |
$category = get_queried_object(); | |
$parent_id = $category->category_parent; | |
$templates = array(); | |
if ( $parent_id == 0 ) { | |
// Use default values from get_category_template() | |
$templates[] = "category-{$category->slug}.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
<script type="text/javascript"> | |
/** | |
* Source: http://stackoverflow.com/a/10540361 | |
* Thanks to: dknaack | |
* | |
* Loads custom color in each of the divs' background on each iteration | |
*/ | |
function get_random_color() { |
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
/** | |
* Author: Michael Fields | |
* Source: http://wordpress.mfields.org/2010/set-default-terms-for-your-custom-taxonomies-in-wordpress-3-0/ | |
* Thanks a lot for the nice tweak | |
*/ | |
/** | |
* Define default terms for custom taxonomies in WordPress 3.0.1 | |
* |
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 | |
// A simple foreach() loop from an array | |
$age_array = array( | |
'0-18' => '0 - 18', | |
'19-25' => '19 - 25', | |
'26-30' => '26 - 30', | |
'31-50' => '31 - 50', | |
'51-65' => '51 - 65', |
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
<div id="secondary" class="widget-area"> | |
<ul class="xoxo"> | |
<?php if ( is_active_sidebar('primary_widget_area') ) : ?> | |
<?php dynamic_sidebar('primary_widget_area'); //load widgets from Admin Panel ?> | |
<?php else : ?> | |
<?php // Load the following widgets we are assigning here ?> | |
<li id="default-widget-1" class="widget-container default-widgets"> |
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
jQuery(document).ready(function($) { | |
$('body.post-new-php #formatdiv input[id="post-format-gallery"], body.post-new-php #formatdiv input[id="post-format-video"]').change(function(){ | |
$('.news-head-div').slideUp(); | |
$('.news-highlight-div').slideUp(); | |
$('#news-position').slideUp(); | |
$('#categorydiv').slideUp(); | |
}); | |
$('body.post-new-php #formatdiv input[id="post-format-0"]').change(function(){ |
OlderNewer