【发布时间】:2016-09-04 20:27:45
【问题描述】:
首先抱歉,如果这是一个简单的问题,这是我第一次使用 html / word press,这只是一个学习练习
基本上我已经在 word-press 上下载了 lawia lite 主题,在这个主题中,他们在主页上有三个图标,下面有文字,我想做的是让它让用户可以点击图像并被带到另一个页面,但是在主题的自定义选项中这是不可能的。
我想我已经找到了与此相关的 php,下面,我的问题是如何修改它以实现我的目标?
<?php
if ( get_theme_mod( 'lawyeria_lite_frontpage_firstlybox_icon',get_template_directory_uri().'/images/features-box-icon-one.png' ) ) {
echo '<div class="features-box-icon">';
echo '<img src="'.get_theme_mod( 'lawyeria_lite_frontpage_firstlybox_icon', get_template_directory_uri().'/images/features-box-icon-one.png' ).'" alt="'.get_theme_mod( 'lawyeria_lite_frontpage_firstlybox_title' ).'" title="'.get_theme_mod( 'lawyeria_lite_frontpage_firstlybox_title' ).'" ;/>';
echo '</div>';
}
if ( get_theme_mod( 'lawyeria_lite_frontpage_firstlybox_title','Lorem' ) ) {
echo '<h4>';
echo get_theme_mod( 'lawyeria_lite_frontpage_firstlybox_title','Lorem' );
echo '</h4>';
}
if ( get_theme_mod( 'lawyeria_lite_frontpage_firstlybox_content','Go to Appearance - Customize, to add content.' ) ) {
echo '<p>';
echo get_theme_mod( 'lawyeria_lite_frontpage_firstlybox_content','Go to Appearance - Customize, to add content.' );
echo '</p>';
}
?>
</div><!--/div .features-box-->
我已经把它缩小到这行代码:
echo '<img src="'.get_theme_mod( 'lawyeria_lite_frontpage_secondlybox_icon',get_template_directory_uri().'/images/features-box-icon-two.png' ).'" alt="'.get_theme_mod( 'lawyeria_lite_frontpage_secondlybox_title','Ipsum' ).'" title="'.get_theme_mod( 'lawyeria_lite_frontpage_secondlybox_title','Ipsum' ).'" />';
我已经尝试添加一个 href
echo '< href="page.php" 'img src="'.get_theme_mod( 'lawyeria_lite_frontpage_secondlybox_icon',get_template_directory_uri().'/images/features-box-icon-two.png' ).'" alt="'.get_theme_mod( 'lawyeria_lite_frontpage_secondlybox_title','Ipsum' ).'" title="'.get_theme_mod( 'lawyeria_lite_frontpage_secondlybox_title','Ipsum' ).'" />';
但这会给出 HTTP ERROR 500
非常感谢
【问题讨论】: