如何在标题中插入徽标?
3 个回答
- 投票数
-
- 2013-06-27
尝试稍微修改标题部分以符合标准.这是您现在的代码:
<div id="header-image"> <img width="1102" height="350" alt="" class="header-image" src="http://onofri.org/example/wp-content/uploads/2013/06/header1.jpg"> </div>
您可以在此处修改内容:
<div id="header-image"> <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"> <img src="<?php echo get_template_directory_uri(); ?>/images/logo.png" alt="Logo" width="HERE" height="HERE" /> </a> </div>
现在只有3个步骤:
- 您可以使用上面给出的代码来编辑主题的
header.php
,而不是使用主题的默认标题图像设置. - 您可以通过 cPanel (Web主机的控制面板)将图像上传到主题文件夹的子文件夹中,而不是从"添加新媒体"中插入图像 .
- 不要在徽标中制作带有背景的大图像,而是尝试在Photoshop(或任何图形软件)中制作简单的无背景徽标-如果是Photoshop,请这样做:将徽标图像放置在图层中,只需删除背景图层,然后将图像保存为Web(文件>保存为Web ... [ Ctrl + Alt + Shift + S ]),然后选择格式为 PNG-24 以获得良好效果.然后将其另存为
logo.png
并将其放置到"/wp-content/themes/simplemarket/images/"文件夹中.
希望剩下的一切.如有任何疑问,请随时在下面评论.
Try modifying the header section a bit to comply with the standards. Here is what your code right now:
<div id="header-image"> <img width="1102" height="350" alt="" class="header-image" src="http://onofri.org/example/wp-content/uploads/2013/06/header1.jpg"> </div>
Here is how you can modify the things:
<div id="header-image"> <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"> <img src="<?php echo get_template_directory_uri(); ?>/images/logo.png" alt="Logo" width="HERE" height="HERE" /> </a> </div>
There are only 3 steps now:
- Instead of using the theme's default header image settings, you can edit your theme's
header.php
with the code given above. - Instead of inserting image from the Add New Media, you can upload image via cPanel (Control Panel of your web host) into the theme folder's sub-folder named 'images'.
- And instead of making a huge image with background for your logo, try making a simple background-less logo in Photoshop (or any graphics software) - in case of Photoshop, just do it: after placing the logo image in a layer, just delete the background layer and then save the image for web (File > Save for web... [Ctrl + Alt + Shift + S]) and choose the format PNG-24 for a good result. Then save it as
logo.png
and place it to the '/wp-content/themes/simplemarket/images/' folder.
Hope you get the rest. If any question, please feel free to comment here under.
-
- 2013-06-26
如果有"徽标"功能,它将成为主题的一部分.可能是主题选项,或者是主题自定义系统.
我通常使用自定义标题来为商业网站执行此操作,尽管自定义标题并非专门徽标.这是一个通用的"标题图片"功能.
简而言之,这取决于主题.如果它是您正在创建的主题,则可以编辑主题以将其添加.请参阅已经引用的食典文章.
If there is a "logo" functionality, it will be part of the theme. Perhaps a theme option or part of the theme customization system.
I typically use a Custom Header to do this for commercial sites, though a custom header is not specifically for a logo. It is a generic "header image" function.
In short, this depends on the theme. If it is a theme you are creating, you can edit the theme to add it. See the Codex articles already referenced.
-
- 2013-06-27
要更改标题图像,请转到wordpress的管理面板. 在外观菜单中,单击标题,然后您会找到用于上传标题图像和文本显示在标题中的选项.
如果未显示,则必须编辑头文件,并在头文件中插入以下代码(如果尚不存在).
<?php $header_image = get_header_image(); if ( ! empty( $header_image ) ) : ?> <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" /></a>
To change the header image go to the admin panel of your wordpress. In the appearance menu click on header and there you will find the option to upload your header image and Text to appear in your header.
If it's not showing then you have to edit your header file and insert the following code in your header if it does not exist already.
<?php $header_image = get_header_image(); if ( ! empty( $header_image ) ) : ?> <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" /></a>
我在WordPress世界中是个新人(我来自Joomla)
我在将徽标插入此WordPress测试网站时发现了一些困难: http://onofri.org/example/
我想将徽标放在网站的标题中,而不是" EXAMPLE"文本.
在WordPress配置面板中,我没有找到可以上传徽标的位置,而是自动在标头中放置了" EXAMPLE"文本(我不知道这是否是Joomla中的标准WordPress功能,或者是否这是可以通过某些特定主题使用的功能,或者如果我必须直接将其放入代码中)
但是,即使在主题设置中也找不到它.
我该怎么做才能放置徽标?我是否可以将其直接插入HTML代码中?