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 disable_autop() { | |
global $post; | |
$disable_autop_var = get_post_meta($post->ID, 'disable_autop', TRUE); | |
if ( !empty( $disable_autop_var ) ) { | |
remove_filter('the_content', 'wpautop'); | |
} | |
} | |
add_action ('loop_start', 'disable_autop'); |
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
class DisplayCategoriesWidget extends WP_Widget | |
{ | |
function DisplayCategoriesWidget() | |
{ | |
$widget_ops = array('classname' => 'DisplayCategoriesWidget', 'description' => 'Displays categories' ); | |
$this->WP_Widget('DisplayCategoriesWidget', 'Display Categories Widget', $widget_ops); | |
} | |
function form($instance) | |
{ |
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
/*-------------------------------------------------------------------------skills for portfolio custom post type -*/ | |
register_taxonomy("Skills", array("portfolio"), array("hierarchical" => true, "label" => "Skills", "singular_label" => "Skill", "rewrite" => true)); |
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 to functions.php | |
if (function_exists('register_sidebar')) { | |
register_sidebar(array( | |
'name' => 'Right header', | |
'id' => 'custom-widget-01', | |
'description' => 'Widget Area', | |
'before_widget' => '<div id="one" class="two">', | |
'after_widget' => '</div>', | |
'before_title' => '<h2>', | |
'after_title' => '</h2>' |
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 to functions/custom.php */ | |
/* ---------------------------------- custom pagination for posts -----*/ | |
function j72_pagination($pages = '', $range = 2) | |
{ | |
$showitems = ($range * 2)+1; | |
global $paged; | |
if(empty($paged)) $paged = 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
/* ------------------------------------------------------------------ajax comments - add to functions.php ------- */ | |
add_action('comment_post', 'ajaxify_comments',20, 2); | |
function ajaxify_comments($comment_ID, $comment_status){ | |
if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'){ | |
switch($comment_status){ | |
case "0": | |
wp_notify_moderator($comment_ID); | |
case "1": //Approved comment | |
echo "success"; |