` tag if ( ! is_singular() ) { if ( strpos( $post->post_content, '' ) ) { $classes[] = 'has-read-more-tag'; } else { $classes[] = 'no-read-more-tag'; } } // Check if sticky post if ( ! is_sticky() ) { $classes[] = 'no-sticky'; } // Check if use excerpt for blog page $content = get_theme_mod( 'bulan-blog-content', 'content' ); if ( $content == 'excerpt' && !is_singular() ) { $classes[] = 'use-excerpt'; } return $classes; } add_filter( 'post_class', 'bulan_post_classes' ); /** * Change the excerpt more string. * * @since 1.0.0 * @param string $more * @return string */ function bulan_excerpt_more( $more ) { return ' ' . __( 'Continue Reading', 'bulan' ) . ''; } add_filter( 'excerpt_more', 'bulan_excerpt_more' ); /** * Change the excerpt length. * * @since 1.0.0 * @param string $more * @return string */ function bulan_excerpt_length( $length ) { return 20; } add_filter( 'excerpt_length', 'bulan_excerpt_length', 999 ); /** * Remove theme-layouts meta box on attachment and bbPress post type. * * @since 1.0.0 */ function bulan_remove_theme_layout_metabox() { remove_post_type_support( 'attachment', 'theme-layouts' ); // bbPress remove_post_type_support( 'forum', 'theme-layouts' ); remove_post_type_support( 'topic', 'theme-layouts' ); remove_post_type_support( 'reply', 'theme-layouts' ); } add_action( 'init', 'bulan_remove_theme_layout_metabox', 11 ); /** * Modifies the theme layout on attachment pages. * * @since 1.0.0 */ function bulan_mod_theme_layout( $layout ) { if ( is_attachment() && wp_attachment_is_image() ) { $post_layout = get_post_layout( get_queried_object_id() ); if ( 'default' === $post_layout ) { $layout = '1c'; } } return $layout; } add_filter( 'theme_mod_theme_layout', 'bulan_mod_theme_layout', 15 ); /** * Extend archive title * * @since 1.0.0 */ function bulan_extend_archive_title( $title ) { if ( is_category() ) { $title = single_cat_title( '', false ); } elseif ( is_tag() ) { $title = single_tag_title( '', false ); } return $title; } add_filter( 'get_the_archive_title', 'bulan_extend_archive_title' ); /** * Customize tag cloud widget * * @since 1.0.0 */ function bulan_customize_tag_cloud( $args ) { $args['largest'] = 12; $args['smallest'] = 12; $args['unit'] = 'px'; $args['number'] = 20; return $args; } add_filter( 'widget_tag_cloud_args', 'bulan_customize_tag_cloud' ); /** * Add custom fields to the author profile fields * * @since 1.0.0 */ function bulan_new_contactmethods( $contactmethods ) { $contactmethods['twitter'] = 'Twitter'; $contactmethods['facebook'] = 'Facebook'; $contactmethods['gplus'] = 'Google Plus'; $contactmethods['instagram'] = 'Instagram'; $contactmethods['linkedin'] = 'Linkedin'; // Display the new fields return $contactmethods; } add_filter( 'user_contactmethods', 'bulan_new_contactmethods', 10, 1 );