trymoment 10 ارسال شده در آذر 94 گزارش بازنشر ارسال شده در آذر 94 (ویرایش شده) چطور میشه امکان آپلود لوگو و هدر(تصویر) رو با هم به قالب افزود؟با این تونستم هدر درست کنم// Custom header (Cover)$custom_header_args = array( 'width' => 1500, 'height' => 700, 'header-text' => false );add_theme_support( 'custom-header', $custom_header_args );و<?php if (get_header_image() != '') : ?>url image: <?php header_image(); ?><?php else : ?><?php endif; ?>اما میخوام علاوه بر کاور(هدر) یه لوگو (عکس خودم مثلا) رو به هدر اضافه کنم که در هدر وبسایت کاور و لوگوی وسط چین شده بنمایش در بیاد ویرایش شده آذر 94 توسط trymoment نقل قول لینک به ارسال
بویکا 124 ارسال شده در آذر 94 گزارش بازنشر ارسال شده در آذر 94 چطور میشه امکان آپلود لوگو و هدر(تصویر) رو با هم به قالب افزود؟با این تونستم هدر درست کنم// Custom header (Cover)$custom_header_args = array( 'width' => 1500, 'height' => 700, 'header-text' => false );add_theme_support( 'custom-header', $custom_header_args );و<?php if (get_header_image() != '') : ?>url image: <?php header_image(); ?><?php else : ?><?php endif; ?>اما میخوام علاوه بر کاور(هدر) یه لوگو (عکس خودم مثلا) رو به هدر اضافه کنم که در هدر وبسایت کاور و لوگوی وسط چین شده بنمایش در بیاددوست عزیز نیازی به این کار نیست می تونین با نمونه های ساخت پنل این کار رو راحت انجام بدین نقل قول لینک به ارسال
trymoment 10 ارسال شده در آذر 94 مالک گزارش بازنشر ارسال شده در آذر 94 (ویرایش شده) دوستان نظرتون در مورد این چیه؟و چطور میشه بهش امکان اندازه گذاری و برش تصوی رو بهش داد// allow custom logo image to be added from adminfunction themeslug_theme_customizer( $wp_customize ) {$wp_customize->add_section( 'themeslug_logo_section' , array('title' => __( 'Logo', 'themeslug' ),'priority' => 30,'description' => 'Upload a logo to replace the default site name and description in the header',) );$wp_customize->add_setting( 'themeslug_logo' );$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'themeslug_logo', array('label' => __( 'Logo', 'themeslug' ),'section' => 'themeslug_logo_section','settings' => 'themeslug_logo',) ) );}add_action('customize_register', 'themeslug_theme_customizer');<a class="blog-logo" <img src="<?php echo get_theme_mod( 'themeslug_logo' ); ?>" /></a> ویرایش شده آذر 94 توسط trymoment نقل قول لینک به ارسال
trymoment 10 ارسال شده در آذر 94 مالک گزارش بازنشر ارسال شده در آذر 94 دوستان نظرتون در مورد این چیه؟و چطور میشه بهش امکان اندازه گذاری و برش تصوی رو بهش داد// allow custom logo image to be added from adminfunction themeslug_theme_customizer( $wp_customize ) {$wp_customize->add_section( 'themeslug_logo_section' , array('title' => __( 'Logo', 'themeslug' ),'priority' => 30,'description' => 'Upload a logo to replace the default site name and description in the header',) );$wp_customize->add_setting( 'themeslug_logo' );$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'themeslug_logo', array('label' => __( 'Logo', 'themeslug' ),'section' => 'themeslug_logo_section','settings' => 'themeslug_logo',) ) );}add_action('customize_register', 'themeslug_theme_customizer');<a class="blog-logo" <img src="<?php echo get_theme_mod( 'themeslug_logo' ); ?>" /></a>یه سوال دیگه هم پیش اومده: میشه یه دستور شرطی هم به <a class="blog-logo" <img src="<?php echo get_theme_mod( 'themeslug_logo' ); ?>" /></a>افزود که اگر لوگویی آپلود شد آنگاه این بالایی رو نشون بده و اگر لوگویی آپلود نشده هیچی نشون نده نقل قول لینک به ارسال
imanfakhar 26231 ارسال شده در آذر 94 گزارش بازنشر ارسال شده در آذر 94 یک راهش اینه که از اسکریپتهای مورد استفاده هسته استفاده کنید با اضافه کردنwp_enqueue_script( 'jcrop' );برای آشنایی با نحوه کروپ کردن وهم اینجا رو بخونیدhttp://deepliquid.com/content/Jcrop.htmlبرای شرط همif(get_theme_mod( 'themeslug_logo' )) { ?><a class="blog-logo" <img src="<?php echo get_theme_mod( 'themeslug_logo' ); ?>" /></a><?php } ?> 2 نقل قول لینک به ارسال
پست های پیشنهاد شده
به گفتگو بپیوندید
هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .