__( 'Primary Menu' ), /* 'secondary-menu' => __( 'Secondary Menu' ) */ ) ); }; /** * Address_WIdget Class */ class Address_WIdget extends WP_Widget { /** constructor */ function __construct() { parent::WP_Widget( /* Base ID */'address_widget', /* Name */'Address_Widget', array( 'description' => 'A NPTHEMES Address Widget' ) ); } /** @see WP_Widget::widget */ function widget( $args, $instance ) { extract( $args ); $title = apply_filters( 'widget_title', $instance['title'] ); $address = apply_filters( 'widget_address', $instance['address'] ); echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; if ( $address ) echo $before_address .'

'. html_entity_decode($address) .'

'. $after_address; ?>

'') $exclude_cats = implode(",", get_option($shortname.'_menucats')); //hide empty categories if (get_option($shortname.'_categories_empty') == 'on') $hide = '1'; else $hide = '0'; //dropdown for categories $strdepth2 = ''; if (get_option($shortname.'_enable_dropdowns_categories') == 'on') $strdepth2 = "depth=".get_option($shortname.'_tiers_shown_categories'); if ($strdepth2 == '') $strdepth2 = "depth=1"; $args = "orderby=".get_option($shortname.'_sort_cat')."&order=".get_option($shortname.'_order_cat')."&".$strdepth2."&exclude=".$exclude_cats."&hide_empty=".$hide."&title_li=&echo=0"; $categories = get_categories($args); if (!empty($categories)) { $category_menu = wp_list_categories($args); if ($addUlContainer) echo(''); } } } if ( ! function_exists( 'show_page_menu' ) ){ function show_page_menu(){ $args = array( 'depth' => 2, 'show_date' => '', 'date_format' => get_option('date_format'), 'child_of' => 0, 'exclude' => '', 'include' => '', 'title_li' => '', 'echo' => 1, 'authors' => '', 'sort_column' => 'menu_order, post_title', 'link_before' => '', 'link_after' => '', 'walker' => '' ); $page_menu = wp_list_pages($args); echo $page_menu; } } /* Meta boxes */ function ztit_save_details($post_id){ global $pagenow; if ( 'post.php' != $pagenow ) return $post_id; if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return $post_id; if (isset($_POST["ztit_newsticker"]) && $_POST["ztit_newsticker"] <> '') update_post_meta($post_id, "newsticker", esc_attr($_POST["ztit_newsticker"])); if (isset($_POST["ztit_viewprojectlink"]) && $_POST["ztit_viewprojectlink"] <> '') update_post_meta($post_id, "viewprojectlink", esc_attr($_POST["ztit_viewprojectlink"])); if (isset($_POST["ztit_description"]) && $_POST["ztit_description"] <> '') update_post_meta($post_id, "description", stripslashes($_POST["ztit_description"])); } add_action('save_post', 'ztit_save_details'); function ztit_add_metabox_settings(){ add_meta_box("ztit_post_meta", "Extremer Settings", "ztit_display_options", "post", "normal", "high"); add_meta_box("ztit_post_meta", "Extremer Settings", "ztit_display_options", "page", "normal", "high"); } add_action("admin_init", "ztit_add_metabox_settings"); function ztit_display_options($callback_args) { global $post; $thumbs = array(); $custom = get_post_custom($post->ID); $newsticker = isset($custom["newsticker"][0]) ? $custom["newsticker"][0] : ''; $description = isset($custom["description"][0]) ? $custom["description"][0] : ''; $viewprojectlink = isset($custom["viewprojectlink"][0]) ? $custom["viewprojectlink"][0] : ''; ?>




(used on Portfolio posts)



(used on Single post pages)

The Featured Image is an image that is chosen as the representative image for Posts or Pages. Click the link above to add or change the image for this post.

'; } function stitch_home_image(){ if ( has_post_thumbnail() ) { the_post_thumbnail( 'stitch_home', array('class' => 'postim') ); } else { }; } function stitch_slider_image(){ if ( has_post_thumbnail() ) { the_post_thumbnail( 'stitch_slider', array('class' => 'slidim') ); } else { }; } function new_excerpt_length($length) { return 80; } add_filter('excerpt_length', 'new_excerpt_length'); function new_excerpt_more($more) { return '[...]'; } add_filter('excerpt_more', 'new_excerpt_more'); add_action('wp_footer', 'add_googleanalytics'); function add_googleanalytics() { echo get_option('ztit_analytics'); } // add a favicon to your add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets'); function my_custom_dashboard_widgets() { global $wp_meta_boxes; wp_add_dashboard_widget('custom_help_widget', 'Theme Support', 'custom_dashboard_help'); } function custom_dashboard_help() { echo '

Welcome to Custom Blog Theme! Need help? Contact the developer here. For WordPress Themes visit: NPthemes

'; } // enable threaded comments function enable_threaded_comments(){ if (!is_admin()) { if (is_singular() AND comments_open() AND (get_option('thread_comments') == 1)) wp_enqueue_script('comment-reply'); } } add_action('get_header', 'enable_threaded_comments'); function blog_favicon() { echo ''; } add_action('wp_head', 'blog_favicon'); function wpbeginner_remove_version() { return ''; } add_filter('the_generator', 'wpbeginner_remove_version'); function ShortenText($text,$chars_limit = 50){ // Change to the number of characters you want to display $chars_text = strlen($text); $text = $text." "; $text = substr($text,0,$chars_limit); $text = substr($text,0,strrpos($text,' ')); // If the text has more characters that your limit, //add ... so the user knows the text is actually longer if ($chars_text > $chars_limit) { $text = $text."..."; } return $text; } ?>