require_once (TEMPLATEPATH . '/includes/user-rating.php'); load_theme_textdomain('gonzo', TEMPLATEPATH . '/languages'); $locale = get_locale(); $locale_file = TEMPLATEPATH . "/languages/$locale.php"; if (is_readable($locale_file)) require_once($locale_file); if (!isset($content_width)) $content_width = 900; add_theme_support('post-thumbnails'); add_theme_support('automatic-feed-links'); register_nav_menus(array( 'primary' => __('Primary Navigation', 'gonzo'), 'mobile' => __('Mobile Navigation', 'gonzo'), 'copyright' => __('Footer Copyright Menu', 'gonzo'), 'toplevel' => __('Top Secondary Menu', 'gonzo') )); // Calls in All scripts & styles function load_gonzo_child_styles() { if (is_admin()) return; wp_dequeue_style('main_css'); wp_enqueue_style('main_css', get_stylesheet_directory_uri() . '/style.css'); } add_action('init', 'load_gonzo_child_styles', 11); function load_gonzo_scripts() { if (is_admin()) return; wp_enqueue_script('jquery'); wp_register_script('modernizr', get_template_directory_uri() . '/js/libs/modernizr-2.0.6.min.js'); wp_enqueue_script('modernizr'); wp_register_script('scripts', get_template_directory_uri() . '/js/scripts.js'); wp_enqueue_script('scripts'); } add_action('init', 'load_gonzo_scripts'); // Calls in metabox scripts/js function load_gonzo_metabox() { if (!is_admin()) return; wp_enqueue_style('metabox_css_load', get_template_directory_uri() . '/includes/classes/meta-box/css/style.css'); wp_enqueue_style('metabox_color_load', get_template_directory_uri() . '/includes/classes/meta-box/css/color.css'); wp_register_script('metabox-js-gonzo', get_template_directory_uri() . '/includes/classes/meta-box/js/gonzo.js'); wp_enqueue_script('metabox-js-gonzo'); wp_register_script('metabox-js-clone', get_template_directory_uri() . '/includes/classes/meta-box/js/clone.js'); wp_enqueue_script('metabox-js-clone'); wp_register_script('metabox-js-color', get_template_directory_uri() . '/includes/classes/meta-box/js/color.js'); wp_enqueue_script('metabox-js-color'); } add_action('init', 'load_gonzo_metabox', 11); // Enable threaded comments function enable_threaded_comments() { if (is_singular() AND comments_open() AND (get_option('thread_comments') == 1)) { wp_enqueue_script('comment-reply'); } } add_action('get_header', 'enable_threaded_comments'); // Link to seperated functions require_once (TEMPLATEPATH . '/includes/widget_areas.php'); require_once (TEMPLATEPATH . '/includes/multiple_excerpts.php'); require_once (TEMPLATEPATH . '/includes/comments.php'); require_once (TEMPLATEPATH . '/includes/kreisi_pagination.php'); require_once (TEMPLATEPATH . '/includes/thumbnails.php'); require_once (TEMPLATEPATH . '/includes/menu-alterations.php'); require_once (TEMPLATEPATH . '/includes/classes/Tax-meta-class/class-usage.php'); require_once (TEMPLATEPATH . '/includes/widget-video.php'); require_once (TEMPLATEPATH . '/includes/widget-facebook-fans.php'); require_once (TEMPLATEPATH . '/includes/widget-latest-posts.php'); require_once (TEMPLATEPATH . '/includes/widget-best-reviews.php'); require_once (TEMPLATEPATH . '/option-tree/option-tree.php'); // Link to plugins require_once (TEMPLATEPATH . '/includes/plugins/gallery-to-slideshow/gallery-to-slideshow.php'); require_once (TEMPLATEPATH . '/includes/plugins/dp-flickr-widget/dp-flickr-widget.php'); require_once (TEMPLATEPATH . '/includes/plugins/tabber-tabs-widget/tabber-tabs.php'); // Link to shortcodes require_once (TEMPLATEPATH . '/includes/shortcodes/columns-shortcode.php'); require_once (TEMPLATEPATH . '/includes/shortcodes/buttons-shortcode.php'); require_once (TEMPLATEPATH . '/includes/shortcodes/loops-shortcode.php'); require_once (TEMPLATEPATH . '/includes/shortcodes/tabs-shortcode.php'); require_once (TEMPLATEPATH . '/includes/shortcodes/toggle-shortcode.php'); require_once (TEMPLATEPATH . '/includes/shortcodes/infobox-shortcode.php'); require_once (TEMPLATEPATH . '/includes/shortcodes/embed-shortcode.php'); require_once (TEMPLATEPATH . '/includes/shortcodes/soundcloud-shortcode.php'); // Re-define meta box path and URL define('RWMB_URL', trailingslashit(get_template_directory() . '/includes/classes/meta-box')); define('RWMB_DIR', trailingslashit(get_template_directory() . '/includes/classes/meta-box')); // Include the meta box script require_once RWMB_DIR . 'meta-box.php'; // Include the meta box definition (This is the file where you define meta boxes, see `demo/demo.php`) include get_template_directory() . '/includes/meta-box-config.php'; // Remove image titles add_filter('the_content', 'remove_img_titles', 1000); add_filter('post_thumbnail_html', 'remove_img_titles', 1000); add_filter('wp_get_attachment_image', 'remove_img_titles', 1000); function remove_img_titles($text) { // Get all title="..." tags from the html. $result = array(); preg_match_all('|title="[^"]*"|U', $text, $result); // Replace all occurances with an empty string. foreach ($result[0] as $img_tag) { $text = str_replace($img_tag, '', $text); } return $text; } // Get rid of the font-size on the tagcloud widget add_filter("widget_tag_cloud_args", 'my_tag_cloud_args'); function my_tag_cloud_args($in) { return "smallest=0.9&largest=0.9&number=23&orderby=name&unit=em"; } // Enable post thumbnail preview for custom columns if (!function_exists('fb_AddThumbColumn') && function_exists('add_theme_support')) { // for post and investments function fb_AddThumbColumn($cols) { $cols['thumbnail'] = __('Thumbnail', 'gonzo'); return $cols; } function fb_AddThumbValue($column_name, $post_id) { if ('thumbnail' == $column_name) { // thumbnail of WP 2.9 $thumbnail_id = get_post_meta($post_id, '_thumbnail_id', true); // image from gallery $attachments = get_children(array('post_parent' => $post_id, 'post_type' => 'attachment', 'post_mime_type' => 'image')); if ($thumbnail_id) $thumb = wp_get_attachment_image($thumbnail_id, 'small-square', true); elseif ($attachments) { foreach ($attachments as $attachment_id => $attachment) { $thumb = wp_get_attachment_image($attachment_id, 'small-square', true); } } if (isset($thumb) && $thumb) { echo $thumb; } else { echo __('None', 'gonzo'); } } } // for posts add_filter('manage_posts_columns', 'fb_AddThumbColumn'); add_action('manage_posts_custom_column', 'fb_AddThumbValue', 10, 2); // for investments add_filter('manage_investments_columns', 'fb_AddThumbColumn'); add_action('manage_investments_custom_column', 'fb_AddThumbValue', 10, 2); } // Replace the default ellipsis function trim_excerpt($text) { return rtrim($text, '[...]'); } add_filter('get_the_excerpt', 'trim_excerpt'); class Description_Walker extends Walker_Nav_Menu { /** * Start the element output. * * @param string $output Passed by reference. Used to append additional content. * @param object $item Menu item data object. * @param int $depth Depth of menu item. May be used for padding. * @param array $args Additional strings. * @return void */ function start_el(&$output, $item, $depth, $args) { $classes = empty ($item->classes) ? array() : (array)$item->classes; $class_names = join( ' ' , apply_filters( 'nav_menu_css_class' , array_filter($classes), $item ) ); !empty ($class_names) and $class_names = ' class="' . esc_attr($class_names) . '"'; $output .= "