'leapin_custom_background_cb', ) ); // custom logo add_theme_support('custom-logo', array( 'height' => 70, 'width' => 300, 'flex-width' => true, )); // wp custom header add_theme_support('custom-header', array( 'header-text' => false, )); // title support add_theme_support('title-tag'); // rss thingy add_theme_support('automatic-feed-links'); // Enable support for HTML5 markup. add_theme_support('html5', array( 'comment-list', 'search-form', 'comment-form' )); } /* end pjax blog theme support */ /********************* * EXCERPT SETTING *********************/ // cleaning up excerpt function leapin_excerpt_more($more) { // edit here if you like to change more link description return '...'; } add_filter('excerpt_more', 'leapin_excerpt_more'); function leapin_excerpt_mblength($length) { return 100; } add_filter('excerpt_mblength', 'leapin_excerpt_mblength'); function leapin_excerpt_length($length) { return 300; } add_filter('excerpt_length', 'leapin_excerpt_length', 999); /********************* * INSERT CUSTOM JS AND CSS *********************/ function leapin_inline_js_settings() { $custom_js = LEAPIN_Theme_Mod::get_instance()->get_script(false); if (LEAPIN_DEV) { $is_pro = leapin_is_pro() ? '-pro' : ''; wp_add_inline_script('leapin-script' . $is_pro, $custom_js, 'before'); } else { wp_add_inline_script('leapin-script', $custom_js, 'before'); } } function leapin_inline_css_settings() { $custom_css = LEAPIN_Theme_Mod::get_instance()->get_style(false); wp_add_inline_style('leapin-stylesheet', $custom_css); } /********************* * SET CUSTOM ARCHIVE TITLE *********************/ function leapin_get_the_archive_title($title) { if (is_category()) { $title = single_cat_title('', false); } elseif (is_tag()) { $title = single_tag_title('', false); } elseif (is_tag()) { $title = single_tag_title('', false); } elseif (is_author()) { $title = '' . get_the_author() . ''; } return $title; } add_filter('get_the_archive_title', 'leapin_get_the_archive_title'); /********************* * SET CUSTOM BACKGROUND *********************/ function leapin_custom_background_cb() { // $background is the saved custom image, or the default image. $background = set_url_scheme(get_background_image()); // $color is the saved custom color. // A default has to be specified in style.css. It will not be printed here. $color = get_background_color(); if ($color === get_theme_support('custom-background', 'default-color')) { $color = false; } if (!$background && !$color) { if (is_customize_preview()) { echo ''; } return; } $style = $color ? "background-color: #$color;" : ''; if ($background) { $image = ' background-image: url("' . esc_url($background) . '");'; // Background Position. $position_x = get_theme_mod('background_position_x', get_theme_support('custom-background', 'default-position-x')); $position_y = get_theme_mod('background_position_y', get_theme_support('custom-background', 'default-position-y')); if (!in_array($position_x, array('left', 'center', 'right'), true)) { $position_x = 'left'; } if (!in_array($position_y, array('top', 'center', 'bottom'), true)) { $position_y = 'top'; } $position = " background-position: $position_x $position_y;"; // Background Size. $size = get_theme_mod('background_size', get_theme_support('custom-background', 'default-size')); if (!in_array($size, array('auto', 'contain', 'cover'), true)) { $size = 'auto'; } $size = " background-size: $size;"; // Background Repeat. $repeat = get_theme_mod('background_repeat', get_theme_support('custom-background', 'default-repeat')); if (!in_array($repeat, array('repeat-x', 'repeat-y', 'repeat', 'no-repeat'), true)) { $repeat = 'repeat'; } $repeat = " background-repeat: $repeat;"; // Background Scroll. $attachment = get_theme_mod('background_attachment', get_theme_support('custom-background', 'default-attachment')); if ('fixed' !== $attachment) { $attachment = 'scroll'; } $attachment = " background-attachment: $attachment;"; $style .= $image . $position . $size . $repeat . $attachment; } ?> __('700px by 700px', 'pjax-blog') )); } add_filter('image_size_names_choose', 'leapin_custom_image_sizes'); ?>