教程开始:
3.0版本的模板专用,需要修改3个文件
1.新友情链接样式
位置:jizhi-chlidfooter.php
将以下代码替换原45~49行
<?php
$links_type = _cao(\'site_footer_links_type\',\'home\');
if ($links_type==\'home\' && is_home()) {
$links_is = true;
}elseif ($links_type==\'all\') {
$links_is = true;
}else{
$links_is = false;
}
if ( _cao(\'is_site_footer_links\') && $links_is ): ?>
<div class=\"footer-links\">
<span class=\"i-f-pl-hold\"></span>
<h6><?php echo esc_html__(\'友情链接\',\'riplus\') ;?></h6>
<span class=\"i-f-pl-hold\"></span>
<ul class=\"friendlinks-ul\">
<?php $resul = $wpdb->get_results(\"SELECT * FROM $wpdb->links where link_visible =\'y\' ORDER BY link_id LIMIT 0 , 40\");
foreach ($resul as $key => $item){
echo \'<li><a target=\"_blank\" href=\"\'.$item->link_url.\'\" title=\"\'.$item->link_name.\'\" target=\"_blank\">\'.$item->link_name.\'</a></li>\';
} ?>
<li class=\"zhankr_ylsq\"><a target=\"_blank\" href=\"/links\">友链申请+</a></li>
</ul>
</div>
<?php endif;?>
<?php if ( _cao( \'cao_copyright_text\', \'\' ) != \'\' ) : ?>
<div class=\"site-info\">
<?php echo _cao( \'cao_copyright_text\', \'\' ); ?>
<?php if(_cao(\'cao_ipc_info\')) : ?>
<?php echo _cao(\'cao_ipc_info\')?>
<?php echo _cao(\'cao_ipc2_info\'); ?>
<br>
2.删旧友情链接样式(不需要了)
位置:jizhi-chlidpartsdiy-footer.php
删除66-79行,改好图如下
3.后台功能选项
位置riproinccodestar-frameworkoptionsoptions.theme.php
在第276行添加一下代码
array(
\'id\' => \'is_site_footer_links\',
\'type\' => \'switcher\',
\'title\' => \'是否开启底部友情链接模块\',
\'desc\' => \'添加友情链接在wp后台左侧 链接 添加即可\',
\'default\' => true,
),
array(
\'id\' => \'site_footer_links_type\',
\'type\' => \'select\',
\'title\' => \'友情链接权重类型\',
\'placeholder\' => \'权重类型\',
\'options\' => array(
\'all\' => \'全站底部展示\',
\'home\' => \'只在首页底部展示\',
),
\'default\' => \'home\',
\'dependency\' => array(\'is_site_footer_links\', \'==\', \'true\'),
),