如何用徽标替换网站标题?

时间:2018-12-06 17:13:06

标签: php wordpress

我正在使用通过PHP构建的wordpress主题,这是一个演示主题,因此我无法通过控制面板插入徽标。

php代码:

<header id="masthead" class="site-header <?php echo Kirki::get_option( 'general_sticky_menu' ) == '1' ? 'sticky' : 'no-sticky'; ?>" role="banner">
    <div class="container">
        <div class="row">
            <div class="col-md-12 clearfix">
                <div class="site-branding">
                    <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
                    <?php
                    $description = get_bloginfo( 'description', 'display' );
                    if ( $description || is_customize_preview() ) : ?>
                        <p class="site-description"><?php echo $description ; ?></p>
                    <?php endif; ?>
                </div><!-- .site-branding -->

2 个答案:

答案 0 :(得分:1)

简单。上传您的徽标并替换:

<?php bloginfo( 'name' ); ?>

使用图片HTML。

<img src="logo.gif" alt="Smiley logo" height="42" width="150">

答案 1 :(得分:0)

1-在外观>自定义中使用网站身份。

2-这是为网站徽标启用主题支持的代码行:

ParamList := TStringList.Create();
   for item in Dictionary do
   begin
   ParamList.Add(item.Key + '=' +  item.Value);
   end;

   for I := 0 to Dictionary.Count-1 do begin
   Memo1.Lines.Add(ParamList.Strings[I]);
   end;

  try
  lHTTP := TIdHTTP.Create;
  lHTTP.Request.ContentType := 'application/x-www-form-urlencoded';
  lHTTP.Request.CharSet := 'utf-8';

  try
    memo2.Lines.Text := lHTTP.Post(openapi_url, ParamList);
    except
      on E: Exception do
        ShowMessage('Error on request: '#13#10 + e.Message);
        end
  finally
    lHTTP.Free;
    ParamList.Free;
  end;

二十十六个主题的示例

add_theme_support( 'site-logo', size );
相关问题