__('Primary Menu', 'canvas') ) ); } add_action('after_setup_theme', 'canvas_setup' ); function canvas_widgets_init() { register_sidebar(array( 'id' => 'main-sidebar', 'name' => __('main-sidebar','canvas'), 'description' => __('Sidebar primary', 'canvas'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

')); register_sidebar(array( 'id' => 'sidebar1', 'name' => __('sidebar-footer1','canvas'), 'description' => __('Sidebar footer1', 'canvas'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

')); register_sidebar(array( 'id' => 'sidebar2', 'name' => __('sidebar-footer2','canvas'), 'description' => __('Sidebar footer2', 'canvas'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

')); register_sidebar(array( 'id' => 'sidebar3', 'name' => __('sidebar-footer3','canvas'), 'description' => __('Sidebar footer3', 'canvas'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

')); } add_action('widgets_init', 'canvas_widgets_init'); function canvas_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case 'pingback' : case 'trackback' : ?>
  • ', '' ); ?>

  • id="li-comment-">
    comment_parent ) $avatar_size = 39; echo get_avatar( $comment, $avatar_size ); printf( __( '%1$s on %2$s said:', 'canvas' ), sprintf( '%s', get_comment_author_link() ), sprintf( '', esc_url( get_comment_link( $comment->comment_ID ) ), get_comment_time( 'c' ), sprintf( __( '%1$s at %2$s', 'canvas' ), get_comment_date(), get_comment_time() ))); ?> ', '' ); ?>
    comment_approved == '0' ) : ?>
    __( 'Reply ', 'canvas' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    ' . __( 'Read more »', 'canvas' ) . ''; } function canvas_excerpt_more( $more ) { return ' …' . canvas_continue_reading_link(); } add_filter('excerpt_more', 'canvas_excerpt_more'); add_filter('excerpt_length', 'canvas_excerpt_length'); // -- Function Name : canvas_enqueue_comment_reply // -- Code Reference: http://codex.wordpress.org/Function_Reference/wp_enqueue_script function canvas_enqueue_comment_reply() { if ( is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } } add_action('wp_footer', 'canvas_enqueue_comment_reply'); function canvas_content_nav( $nav_id ) { global $wp_query; if ( $wp_query->max_num_pages > 1 ) : ?> = 2 || $page >= 2 ) $title = "$title $sep " . sprintf( __( 'Page %s', 'canvas' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'canvas_filter_title', 10, 2 ); function canvas_entry_meta() { // Translators: used between list items, there is a space after the comma. $categories_list = get_the_category_list( __( ', ', 'canvas' ) ); // Translators: used between list items, there is a space after the comma. $tag_list = get_the_tag_list( '', __( ', ', 'canvas' ) ); $date = sprintf( '', esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ) ); $author = sprintf( '', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'canvas' ), get_the_author() ) ), get_the_author() ); // Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name. if ( $tag_list ) { $utility_text = __( 'Posted in %1$s and tagged %2$s on %3$s by %4$s.', 'canvas' ); } elseif ( $categories_list ) { $utility_text = __( 'Posted in %1$s on %3$s by %4$s.', 'canvas' ); } else { $utility_text = __( 'Posted on %3$s by %4$s.', 'canvas' ); } printf( $utility_text, $categories_list, $tag_list, $date, $author ); } // -- Function Name : canvas_breadcrumb // -- I got from responsive theme by emiluzelac, thank's emil this great for bbpress // -- bbPress compatibility patch by Dan Smith function canvas_breadcrumb_link() { $canvas = ''; $home = __('Home','canvas'); // text for the 'Home' link $before = ''; // tag before the current crumb $after = ''; // tag after the current crumb if ( !is_home() && !is_front_page() || is_paged() ) { echo ''; } } add_action( 'canvas_breadcrumb', 'canvas_breadcrumb_link' ); function canvas_category_list_rel($output) { $output = str_replace(' rel="category tag"', '', $output); return $output; } add_filter('wp_list_categories', 'canvas_category_list_rel'); add_filter('the_category', 'canvas_category_list_rel'); //UNTITLE LINK function canvas_takberjudul($title) { if ($title == '') { return 'Untitled'; } else { return $title; } } add_filter('the_title', 'canvas_takberjudul'); // Disable jump in 'read more' link function canvas_remove_more_jump_link($link) { $offset = strpos($link, '#more-'); if ($offset) { $end = strpos($link, '"',$offset); } if ($end) { $link = substr_replace($link, '', $offset, $end-$offset); } return $link; } add_filter('the_content_more_link', 'canvas_remove_more_jump_link'); // -- Function Name : canvas_content_nav // -- Params : // -- Code Reference: function canvas_content_navi() { global $wp_query; $paged = ( get_query_var( 'paged' ) ) ? intval( get_query_var( 'paged' ) ) : 1; $pagenum_link = get_pagenum_link(); $url_parts = parse_url( $pagenum_link ); $format = ( get_option('permalink_structure') ) ? user_trailingslashit('page/%#%', 'paged') : '?paged=%#%'; if ( isset($url_parts['query']) ) { $pagenum_link = "{$url_parts['scheme']}://{$url_parts['host']}{$url_parts['path']}%_%?{$url_parts['query']}"; } else { $pagenum_link .= '%_%'; } $links = paginate_links( array( 'base' => $pagenum_link, 'format' => $format, 'total' => $wp_query->max_num_pages, 'current' => $paged, 'mid_size' => 2, 'type' => 'list' ) ); if ( $links ) { echo "
    {$links}
    "; } } add_action( 'canvas_navi', 'canvas_content_navi' ); function canvas_custom_header_setup() { $args = array( // Text color and image (empty to use none). 'default-text-color' => '444', 'default-image' => '', // Set height and width, with a maximum value for the width. 'height' => 250, 'width' => 960, 'max-width' => 2000, // Support flexible height and width. 'flex-height' => true, 'flex-width' => true, // Random image rotation off by default. 'random-default' => false, // Callbacks for styling the header and the admin preview. 'wp-head-callback' => 'canvas_header_style', 'admin-head-callback' => 'canvas_admin_header_style', 'admin-preview-callback' => 'canvas_admin_header_image', ); add_theme_support( 'custom-header', $args ); } add_action( 'after_setup_theme', 'canvas_custom_header_setup' ); global $themecolors; $themecolors = array( 'bg' => '', 'border' => '', 'text' => '', 'link' => '', 'url' => '', ); function canvas_header_style() { $text_color = get_header_textcolor(); // If no custom options for text are set, let's bail if ( $text_color == get_theme_support( 'custom-header', 'default-text-color' ) ) return; // If we get this far, we have custom styles. ?>

    onclick="return false;" href="">

    >