.
*/
// Checks to See Wordpress Version
global $wp_version;
// If it's not compatable with wordpress version 3.0 die and display message.
if ( !version_compare($wp_version,"3.0",">=") )
{
die("
You need at lease version 3.0 of Wordpress to use the TinCrate plugin.
\n";
// Each output_key creates a li > category color block > category name
endwhile; else:
$output .= "No posts available. Double check your the post-tiles shortcode, selected categories, and number of posts.";
endif;
// Reset the query so it doesn't interupt the normal query
wp_reset_query();
// If responsive it true add responsive class
if ($responsive_key == "true") {
$responsive = "class='responsive'";
}
// Display Key
$show_key = get_option('category-key');
$show_key_jquery = get_option('category-key-jquery');
$featured_images_key= get_option('featured-images');
// If it's empty then the default value is false (default)
if(empty($show_key)){
$show_key == "false";
}
// If it's true then build the key.
if ($show_key == "true"){
$ca_args = array(
// $cat_num pulls from shortcode
'include' => $cat_num
);
//List categories
$categories = get_categories($ca_args);
//Loops through each category and displays key and color.
foreach($categories as $category) {
// Set's category names
$cat_var = $category->name;
// Sets the slug
$cat_slug = $category->slug;
// Cleans up category names that have spaces
$cat_var_key = "cat_".$cat_slug;
// Get's the category options which are the hexadecimal colors
$cat_var_key_val = get_option($cat_var_key);
// loops through the each category and prints them
$key_items .= "".$cat_var."\n";
}
// Creates the finished key
$key_finished = "