我可以从代码中添加链接到我自己的wordpress主题上的图片吗?

我是wordpress新手。我已经开始创建自定义主题。我得到我的内容通过以下方法:

<?php 
if ( have_posts() ) {
    while ( have_posts() ) {
        the_post(); 
        //
        the_content()
        //
    } // end while
} // end if
?>

我在我的网站上添加了很多图片。这些图片从wordpress自动调整大小。我想添加超链接(同一图像的链接)的所有图像在一篇文章。但我不想一个一个地手动做。

以下是我想要达到的目标:

 <img src="sample.img" /> 

 //to convert 

 <a href="sample.img" class="mycustomclass"> 
   // Image link: 
   <img src="sample.img">
 </a>

#1


按照以下步骤在Wordpress WYSIWYG编辑器中链接图像。https://en.support.wordpress.com/links/image-links/

来源:

https://www.srcmini02.com/64872.html

微信公众号
手机浏览(小程序)
0
分享到:
没有账号? 忘记密码?