Skip to content

Instantly share code, notes, and snippets.

@alexkingorg
alexkingorg / sort-colors.php
Created March 22, 2012 13:44
Sort colors from dark to light
<?php
function cf_sort_hex_colors($colors) {
$map = array(
'0' => 0,
'1' => 1,
'2' => 2,
'3' => 3,
'4' => 4,
'5' => 5,
@alexkingorg
alexkingorg / favepersonal-content-links-underlined.css
Created March 26, 2012 18:21
Underline links in FavePersonal content areas.
@alexkingorg
alexkingorg / favepersonal-hide-header-mobile.css
Created March 26, 2012 18:23
Hide header in FavePersonal on small mobile devices
/* Hide the header on small mobile devices */
@media screen and (max-width: 768px) {
#masthead {
display: none;
}
}
@alexkingorg
alexkingorg / favepersonal-reduce-header-featured-height.css
Created March 26, 2012 18:24
Reduce header and featured post box height in FavePersonal
@alexkingorg
alexkingorg / favepersonal-remove-inline-color-css.php
Created March 26, 2012 21:52
Remove inline CSS styles for Colors from FavePersonal header
<?php
// remove the CSS for Colors from the HTML (if you want to load it via child theme instead)
function favepersonal_remove_inline_color_css() {
remove_action('wp_head', 'cfcp_color_css_min', 8);
}
add_action('wp', 'favepersonal_remove_inline_color_css', 11);
@alexkingorg
alexkingorg / favepersonal-loop-home.php
Created March 29, 2012 14:52
Show full content for the first three "standard" format posts in the loop in FavePersonal.
<?php
// Place this file inside your child theme as /loop/home.php
// Shows full content for the first three "standard" format posts in the loop
if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { die(); }
if (CFCT_DEBUG) { cfct_banner(__FILE__); }
global $post;
@alexkingorg
alexkingorg / favepersonal-link-excerpt-full-content.php
Created April 1, 2012 18:44
Show full content in excerpt for all link posts in FavePersonal (or any Carrington Core theme).
@alexkingorg
alexkingorg / wp-post-formats-as-categories.php
Created May 18, 2012 20:05
WordPress Post Formats as Categories
<?php
/*
Plugin Name: Formats as Categories
Plugin URI: http://alexking.org/projects/wordpress
Description: Have enabled post formats show up as categories for selection via XML-RPC clients (iPhone, Android, etc.).
Version: 1.0dev
Author: Crowd Favorite
Author URI: http://crowdfavorite.com
*/
@alexkingorg
alexkingorg / cfct-template-file-globals.php
Created May 27, 2012 17:11
cfct_template_file() and Globals
<?php
/**
* Include a specific file based on directory and filename
*
* @param string $dir Directory the file will be in
* @param string $file Filename
* @param array $data pass in data to be extracted for use by the template
*
**/
function cfct_template_file($dir, $file, $data = array()) {
@alexkingorg
alexkingorg / maybe-include-plugin.php
Created July 6, 2012 14:25
Conditional loading of a plugin within a WordPress theme.
<?php
// Run this code on 'after_theme_setup', when plugins have already been loaded.
add_action('after_setup_theme', 'my_load_plugin');
// This function loads the plugin.
function my_load_plugin() {
// Check to see if your plugin has already been loaded. This can be done in several
// ways - here are a few examples: