Radha hỏi,
làm cách nào để vùng tiêu đề nổi sang trái & nhỏ hơn (ngay bây giờ nó nhận được 1120px từ đâu đó) và các biểu tượng xã hội nổi sang phải? Trên thiết bị di động, biểu trưng nên được xếp chồng lên nhau trên các biểu tượng xã hội - tất cả đều đẹp và ở giữa.
Khi nói đến logo và tiêu đề trong WordPress, theo tôi, nội tuyến là cách để đi, không phải hình nền.
Đây là màn hình kết quả sau khi thực hiện các bước sau:
Bước 1
Tải hình ảnh biểu trưng / tiêu đề lên images
thư mục của chủ đề con bằng ứng dụng khách FTP hoặc trình quản lý tệp cPanel.
Bước 2
Sửa DailyDish Pro functions.php .
Nhận xét ra hoặc xóa
unregister_sidebar( 'header-right' );
Thêm cái này vào gần cuối:
/**********************************
*
* Replace Header Site Title with Inline Logo
*
* Fixes Genesis bug - when using static front page and blog page (admin reading settings) Home page is <p> tag and Blog page is <h1> tag
*
* Replaces "is_home" with "is_front_page" to correctly display Home page wit <h1> tag and Blog page with <p> tag
*
* @author AlphaBlossom / Tony Eppright
* @link http://www.alphablossom.com/a-better-wordpress-genesis-responsive-logo-header/
*
* @edited by Sridhar Katakam
* @link http://www.sridharkatakam.com/use-inline-logo-instead-background-image-genesis/
*
************************************/
add_filter( 'genesis_seo_title', 'custom_header_inline_logo', 10, 3 );
function custom_header_inline_logo( $title, $inside, $wrap ) {
$logo = '<img src="' . get_stylesheet_directory_uri() . '/images/siteHeader.jpg" alt="' . esc_attr( get_bloginfo( 'name' ) ) . '" title="' . esc_attr( get_bloginfo( 'name' ) ) . '" width="510" height="130" />';
$inside = sprintf( '<a href="%s" title="%s">%s</a>', trailingslashit( home_url() ), esc_attr( get_bloginfo( 'name' ) ), $logo );
// Determine which wrapping tags to use - changed is_home to is_front_page to fix Genesis bug
$wrap = is_front_page() && 'title' === genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : 'p';
// A little fallback, in case an SEO plugin is active - changed is_home to is_front_page to fix Genesis bug
$wrap = is_front_page() && ! genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : $wrap;
// And finally, $wrap in h1 if HTML5 & semantic headings enabled
$wrap = genesis_html5() && genesis_get_seo_option( 'semantic_headings' ) ? 'h1' : $wrap;
return sprintf( '<%1$s %2$s>%3$s</%1$s>', $wrap, genesis_attr( 'site-title' ), $inside );
}
// Remove the site description
remove_action( 'genesis_site_description', 'genesis_seo_site_description' );
đâu là tên của logo / hình ảnh tiêu đề có trong thư mục hình ảnh của DailyDish Pro và 510 x 130 là kích thước của nó.siteHeader.jpg
Bước 3
Tại Appearance> Widgets, kéo widget của plugin Simple Social Icons vào vùng widget Header Right.
Bước 4
Thêm cái này vào style.css :
.site-header {
text-align: left;
padding: 40px 0;
}
.title-area {
float: left;
}
.site-title {
margin-bottom: 0;
}
.header-widget-area {
float: right;
padding-top: 30px;
}
@media only screen and (max-width: 768px) {
.site-header {
text-align: center;
}
.title-area,
.header-widget-area {
float: none;
}
.header-widget-area .simple-social-icons ul.alignleft {
text-align: center;
float: none;
}
.header-widget-area .simple-social-icons ul li {
float: none;
display: inline-block;
}
}