我想创建通过Wordpress 自定义功能加载徽标的可能性。当我使用插入徽标时get_theme_mod()- 它只是图像的 url,但我也想获取此图像的替代文本。
我的代码示例:
函数.php
function welbit_theme_customizer( $wp_customize ) {
$wp_customize->add_section( 'welbit_logo_section' , array(
'title' => __( '???????', 'themeslug' ),
'priority' => 30,
'description' => '????????? ????? ???????????.',
) );
$wp_customize->add_setting( 'welbit_logo' );
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'welbit_logo', array(
'label' => __( 'Logo', 'welbit' ),
'section' => 'welbit_logo_section',
'settings' => 'welbit_logo',
) ) );
}
add_action( 'customize_register', 'welbit_theme_customizer' );
Run Code Online (Sandbox Code Playgroud)
头文件
<div class="w-header__logo">
<a href="<?php echo get_home_url(); ?>">
<img src="<?php print_r(get_theme_mod('welbit_logo'));?>" alt="<!-- How can I get …Run Code Online (Sandbox Code Playgroud) 我有带渐变的列。需要创建一个从右上角开始到左下角的渐变,但渐变的角落被剪掉了。它看起来很丑,并且渐变的角落没有链接。我尝试使用背景图像,但在移动设备上工作很糟糕。
<section class="slider">
<div class="container slider-menu">
<div class="col-lg-5ths col-md-5ths col-sm-5ths col-xs-4"><img src="http://rustypepper.me/production/img/icon-2.png" alt="??????" class="img-responsive">
<p>
Lorem <br> Ipsum
</p>
</div>
// ........ 14 same columns
</section>
.slider-menu div {
background: #006bac;
position: relative;
margin-bottom:5px;
height: 240px; }
.slider-menu div img {
position: relative;
z-index: 999; }
.slider-menu div:after {
content: "";
position: absolute;
top: 0;
left: 0;
opacity: 0.1;
width: 100%;
height: 100%;
z-index: 1;
background: black;
/* Old browsers */
background: -moz-linear-gradient(45deg, black 0%, white 51%, black 51%, white …Run Code Online (Sandbox Code Playgroud)