简体   繁体   English

如何在wordpress帖子标题中插入图片?

[英]How to insert image in wordpress post title?

I want to know how to put an image into the wordpress title, only by the backend. 我想知道如何仅通过后端将图像放入wordpress标题中。 At the moment is use the Wordpress-URL in my code like this: 目前,在我的代码中使用Wordpress-URL是这样的:

<img 
 src="http://wp.cloudstarter.de/wp-content/uploads/2013/09/logo-cloudshare.png" 
/>

But I want to control, remove and replace my picture just in the Backend. 但是我只想在后端中控制,删除和替换图片。 Right now, i just did not figure it out yet how to use my Images in the title of a specific post. 现在,我只是还没有弄清楚如何在特定帖子的标题中使用我的图片。

If you want to display the image next to post title, you may need to add Custom fields and edit the post title showing template(usually content-page.php) to integrate the custom field. 如果要在帖子标题旁边显示图像,则可能需要添加“ 自定义”字段并编辑显示模板(通常为content-page.php)的帖子标题以集成自定义字段。 So when adding the post you need to set the image in the custom field and as title showing part contains the script to display the image, the title will be displayed with the image. 因此,添加帖子时,您需要在自定义字段中设置图像,并且标题显示部分包含显示图像的脚本,标题将与图像一起显示。

get your header.php code. 获取您的header.php代码。 You can find the code by editing the header.php file. 您可以通过编辑header.php文件找到代码。

To edit the file: 要编辑文件:

1) Login to WP admin panel 1)登录WP管理面板

2) Click Appearance in the left sidebar 2)点击左侧栏中的外观

3) Click Editor 3)点击编辑器

4) In this page click on the header.php link (to edit the file) in the right side of the screen. 4)在此页面中,单击屏幕右侧的header.php链接(以编辑文件)。

5) Copy the code and paste in this forum. 5)复制代码并粘贴到该论坛中。

Put the code between Your code here 将代码放在您的代码之间

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM