Привет!У меня есть сайт на WordPress.Мне нужно изменить шрифт заголовка статьи.
Index.php
<?php get_header(); ?>
<div class="banner">
<div class="banner-image">
<?php if( get_field('des-off', 'options') == 'true' ):
$image = get_field('desc-img', 'options');
if( !empty($image) ):
$size = 'desctop';
$thumb = $image['sizes'][ $size ];
?>
<img class="dont-show hidden-xs" src="<?php echo $thumb; ?>" />
<?php endif; endif; ?>
<?php if( get_field('mob-off', 'options') == 'true' ):
$image = get_field('mob-img', 'options');
if( !empty($image) ):
$size = 'mobail';
$thumb = $image['sizes'][ $size ];
?>
<img class="mobi-logo hidden-sm hidden-md hidden-lg" src="<?php echo $thumb; ?>" />
<?php endif; endif; ?>
<?php if( get_field('des-off', 'options') == 'true' ): ?>
<div class="banner-title dont-show hidden-xs">
<div class="banner-tbl dont-show">
<div class="banner-td dont-show">
<div class="container dont-show">
<?php the_field('des-ban', 'options'); ?>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php if( get_field('mob-off', 'options') == 'true' ): ?>
<!--mobil banner-->
<div class="banner-title dont-show hidden-sm hidden-md hidden-lg">
<div class="banner-tbl dont-show">
<div class="banner-td dont-show">
<div class="container dont-show mob-ban">
<?php the_field('mob-ban', 'options'); ?>
</div>
</div>
</div>
</div>
<?php endif; ?>
</div>
<!--Форма подписки после баннера-->
<?php if( get_field('home-pdf2', 'options') == 'true' ): ?>
<div class="container dont-show">
<div class="row product">
<div class="col-xs-6 col-sm-3 col-md-3 cover">
<img alt="<?php bloginfo('name'); ?>" src="<?php bloginfo('template_url'); ?>/images/book-cover-top.png" />
</div>
<div class="col-xs-12 col-sm-12 col-md-9 subscribe">
<div style="font-family: 'PT Serif';">
<?php the_field('home-pdf1', 'options'); ?>
<div>
<form class="form-inline">
<div class="form-group">
<input type="name" class="form-control input-lg" id="InputName" placeholder="<?php printf( _e( 'Your Name', 'zaxidna' )); ?>">
</div>
<div class="form-group">
<input type="email" class="form-control input-lg" id="InputEmail" placeholder="<?php printf( _e( 'E-mail', 'zaxidna' )); ?>">
</div>
<button type="submit" class="btn btn-lg"><?php printf( _e( 'Get Now', 'zaxidna' )); ?></button>
</form>
</div>
</div>
</div>
<?php endif; ?>
<!-- END Форма подписки после баннера-->
</div>
<div class="container mobi-bg">
<div class="row">
<div class="col-xs-12 col-md-8">
<nav class="categories hidden-xs">
<?php wp_nav_menu(array('menu' => 'categories', 'menu_class' => 'list-inline')); ?>
<hr />
</nav>
<main id="book-form" class="content">
<?php if ( have_posts() ) : ?>
<?php
while ( have_posts() ) : the_post();?>
<?php get_template_part( 'content', get_post_format() );
endwhile;
?>
<nav>
<?php wpex_pagination(); ?>
</nav>
<?php
else :
get_template_part( 'content', 'none' );
endif;
?>
</main>
</div>
<div class="col-xs-12 col-md-4 side">
<form role="search" method="get" id="searchform" class="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<div class="form-group">
<input type="text" value="<?php echo get_search_query(); ?>" class="form-control" name="s" id="s" placeholder="<?php printf( _e( 'Search', 'zaxidna' )); ?>" />
<button type="submit" id="searchsubmit" class="btn"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></button>
</div>
</form>
<?php get_sidebar(); ?>
</div>
</div>
</div>
<?php get_footer(); ?>
functions.php:
<?php
if (!function_exists('add_scripts')) {
function add_scripts() {
wp_deregister_script('jquery');
wp_enqueue_script('jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js', '', '', true);
wp_enqueue_script('jq', '//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5852c94376ed1e7c', '', '', true);
wp_enqueue_script('bootstrap', get_template_directory_uri() . '/libs/bootstrap/js/bootstrap.min.js', '', '', true);
wp_enqueue_script('main', get_template_directory_uri() . '/js/js.js', '', '', true);
}
}
add_action('wp_footer', 'add_scripts');
if (!function_exists('add_styles')) {
function add_styles() {
//wp_enqueue_style('bs', get_template_directory_uri() . '/libs/bootstrap/css/bootstrap.min.css');
wp_enqueue_style('main', get_template_directory_uri() . '/style.css');
//wp_register_style('font-style', 'https://fonts.googleapis.com/css?family=Open+Sans:400,400i,600,700,700i,800&subset=cyrillic');
wp_enqueue_style('font-style');
}
}
add_action('wp_print_styles', 'add_styles');
add_filter('use_default_gallery_style', '__return_false');
show_admin_bar(false);
if (function_exists('register_sidebar'))
register_sidebar(array(
'name' => 'Side About',
'id' => 'side-about',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h5>',
'after_title' => '</h5>',
));
if (function_exists('register_sidebar'))
register_sidebar(array(
'name' => 'Side Widgets',
'id' => 'side-widgets',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h5>',
'after_title' => '</h5>',
));
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'wp_generator');
add_theme_support('post-thumbnails');
add_theme_support('post-formats', array('image', 'video', 'quote'));
add_image_size('desctop', 1519, 570, true);
add_image_size('mobail', 736, 334, true);
function get_ID_by_slug($page_slug) {
$page = get_page_by_path($page_slug);
if ($page) {
return $page->ID;
} else {
return null;
}
}
add_filter('comment_form_default_fields', 'bootstrap3_comment_form_fields');
function bootstrap3_comment_form_fields($fields) {
$commenter = wp_get_current_commenter();
$req = get_option('require_name_email');
$aria_req = ( $req ? " aria-required='true'" : '' );
$html5 = current_theme_supports('html5', 'comment-form') ? 1 : 0;
$fields = array(
'author' => '<div class="row"><div class="col-xs-12 col-md-6"><div class="form-group comment-form-author">' .
'<input class="form-control" placeholder="' . __('Введите Ваше Имя') . ( $req ? ' *' : '' ) . '" id="author" name="author" type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30"' . $aria_req . ' /></div></div>',
'email' => '<div class="col-xs-12 col-md-6"><div class="form-group comment-form-email">' .
'<input class="form-control" placeholder="' . __('Введите Ваш Email') . ( $req ? ' *' : '' ) . '" id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr($commenter['comment_author_email']) . '" size="30"' . $aria_req . ' /></div></div></div>',
'url' => '<div class="form-group comment-form-url">' .
'<input class="form-control" placeholder="' . __('Сайт (необязательно)') . '" id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr($commenter['comment_author_url']) . '" size="30" /></div>'
);
return $fields;
}
add_filter('comment_form_defaults', 'bootstrap3_comment_form');
function bootstrap3_comment_form($args) {
$args['comment_field'] = '<div class="form-group comment-form-comment">
<textarea class="form-control" id="comment" name="comment" placeholder="Напишите комментарий" aria-required="true"></textarea>
</div>';
$args['class_submit'] = 'btn'; // since WP 4.1
return $args;
}
add_filter('request', 'my_request_filter');
function my_request_filter($query_vars) {
if (isset($_GET['s']) && empty($_GET['s'])) {
$query_vars['s'] = " ";
}
return $query_vars;
}
require_once('wp_bootstrap_navwalker.php');
function my_custom_post_navigation($terms, $object_ids, $taxonomies, $args) {
return array_slice($terms, 0, 1);
}
if (!function_exists('wpex_pagination')) {
function wpex_pagination() {
$prev_arrow = is_rtl() ? '<span class="glyphicon glyphicon-triangle-right" aria-hidden="true"></span>' : '<span class="glyphicon glyphicon-triangle-left" aria-hidden="true"></span>';
$next_arrow = is_rtl() ? '<span class="glyphicon glyphicon-triangle-left" aria-hidden="true"></span>' : '<span class="glyphicon glyphicon-triangle-right" aria-hidden="true"></span>';
global $wp_query, $the_query;
if ($the_query) {
$total = $the_query->max_num_pages;
} else {
$total = $wp_query->max_num_pages;
}
$big = 999999999;
if ($total > 1) {
if (!$current_page = get_query_var('paged'))
$current_page = 1;
if (get_option('permalink_structure')) {
$format = 'page/%#%/';
} else {
$format = '&paged=%#%';
}
echo paginate_links(array(
'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
'format' => $format,
'current' => max(1, get_query_var('paged')),
'total' => $total,
'mid_size' => 3,
'type' => 'list',
'prev_text' => $prev_arrow,
'next_text' => $next_arrow,
));
}
}
}
function trim_title_chars($count, $after) {
$title = get_the_title();
if (mb_strlen($title) > $count)
$title = mb_substr($title, 0, $count);
else
$after = '';
echo $title . $after;
}
if (function_exists('acf_add_options_page')) {
$option_page = acf_add_options_page(array(
'page_title' => 'Мобильное меню',
'menu_title' => 'Мобильное меню',
'menu_slug' => 'theme-general-settings',
//'capability' => 'edit_posts',
//'redirect' => false
));
$option_page2 = acf_add_options_page(array(
'page_title' => 'Общие настройки сайта',
'menu_title' => 'Настройки шаблона',
'menu_slug' => 'theme-general-settings2',
//'capability' => 'edit_posts',
//'redirect' => false
));
}
add_action('admin_head', 'moi_novii_style');
function moi_novii_style() {
print '<style>
/*Стили в админку
#menu-appearance,
#menu-tools,
#menu-users,
#menu-plugins,
#toplevel_page_edit-post_type-acf-field-group
#menu-posts,
#menu-dashboard,
.update-nag{display:none!important;
*/
.update-nag,
#toplevel_page_edit-post_type-acf-field-group
{display:none!important;}
.toplevel_page_theme-general-settings2 .acf-fields > .acf-field {
border-bottom: #ff0101 solid 3px;
}
</style>';
}
function enable_more_buttons($buttons) {
$buttons[] = 'hr';
$buttons[] = 'fontselect';
$buttons[] = 'sup';
// и так далее ...
return $buttons;
}
add_filter("mce_buttons", "enable_more_buttons");
В вашем случае добавьте в style.css вашей темы примерно такое правило:
article>h3 a {
font-family: Open Sans,sans-serif !important;
}
Но, вообще-то, для модификаций надо использовать дочерние темы: https://wp-kama.ru/id_6235/dochernie-temy-wordpress.html
Кофе для программистов: как напиток влияет на продуктивность кодеров?
Рекламные вывески: как привлечь внимание и увеличить продажи
Стратегії та тренди в SMM - Технології, що формують майбутнє сьогодні
Выделенный сервер, что это, для чего нужен и какие характеристики важны?
Современные решения для бизнеса: как облачные и виртуальные технологии меняют рынок
Запускаю Laravel:54 + Voyager в Docker
У меня есть форма, которая обрабатывается и данные которые ввёл пользователь выводятся на страницеТакже есть проверка, что если поле оставлено...
Изучал код ,рисующий треугольник(с известного learnopengl) меня интересует вот такой момент