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 ## functions.php | |
/** | |
* This 'registers' the sidebar and tells WordPress it exists, as well as names it | |
* and gives it wrapping markup for each widget, and the title if applicable. | |
* | |
* Change the markup to meet your needs. | |
*/ | |
if (function_exists('register_sidebar')) { | |
register_sidebar(array( | |
'name' => 'Hero', |
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 print_pre($array){ | |
echo "<pre style='z-index:1000;background-color:rgba(192,192,192,0.9);left:0;top:100px;width:4000px;overflow:scroll;position:absolute;white-space: pre;'>"; | |
print_r($array); | |
echo "</pre>"; | |
} | |
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
add_filter('cth_category_template', 'descendant_templates'); | |
/** | |
* My plugin will call your function, and pass it the list of all templates | |
* before sending them off to find which ones match. | |
*/ | |
function descendant_templates($templates){ | |
if(is_category()){ | |
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
// In function kd_meta_box_output() replace | |
$thumbnail = wp_get_attachment_image( $image_id, array( 266, 266 ) ); | |
//With... | |
$type = get_post_mime_type($iamge_id); | |
$icon = in_array($type, array('application/pdf')) ? true : false; | |
$thumbnail = wp_get_attachment_image( $image_id, array( 266, 266 ), $icon ); |
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
define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/wp-content' ); | |
define( 'WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins' ); | |
define( 'PLUGINDIR', $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins' ); | |
define( 'WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']); | |
define( 'WP_HOME', 'http://' . $_SERVER['HTTP_HOST']); | |
define( 'WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/wp-content'); | |
define( 'WP_PLUGIN_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/wp-content/plugins'); | |
define( 'UPLOADS', 'wp-content/uploads' ); |
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 return_template_part($template, $specialized_name = ''){ | |
ob_start(); | |
get_template_part($template, $specialized_name); | |
return ob_get_clean(); | |
} |
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: Boilerplate Widget | |
Description: Starting point for building widgets quickly and easier | |
Version: 1.0 | |
Author: Eddie Moya | |
/** | |
* IMPORTANT: Change the class name for each widget | |
*/ | |
class Boilerplate_Widget extends WP_Widget { |
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
SELECT DISTINCT | |
u.ID, | |
u.user_login, | |
u.user_nicename, | |
u.user_email, | |
u.display_name, | |
m2.meta_value as role, | |
GROUP_CONCAT(DISTINCT m.meta_value) AS terms | |
FROM wp_users as u | |
LEFT JOIN wp_usermeta AS m |
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 get_user_role_tax_intersection($args = array()){ | |
global $wpdb; | |
$default_args = array( | |
'hide_untaxed' => true | |
'terms' => array(), | |
'roles' => array('administrator') | |
); | |
$args = array_merge($default_args, $args); |
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
<!-- OLD --> | |
<article class="widget content-container span12 image-widget"> | |
<header class="content-header"> | |
<h3>Discover ideas. Ask Questions. Be you. Welcome to the Community.</h3> | |
</header> | |
<article class="content-container"> | |
<img src=""> | |
</article> | |
</article> |
OlderNewer