zibll主题修改zib-footer版权提醒,备案号-zibll教程分享社区-zibll子比主题-WordPress主题模板-zibll子比主题

zibll主题修改zib-footer版权提醒,备案号

    在主题中footer.php文件往往都是网站底部信息的配置.

    首先./zibll/footer.php这个文件,里面的代码很简单:

<footer class="footer">
    <?php if (function_exists('dynamic_sidebar')) {
    dynamic_sidebar('all_footer');
    } ?>
<div class="container-fluid container-footer">
     <?php $footer=do_action('zib_footer_conter'); ?>
</div>
</footer>
<?php
wp_footer();

?>
</body>
</html>

        其中<?php $footer=do_action(‘zib_footer_conter’); ?>这部分代码,即是指向的我们底部配置信息.

那么”zib_footer_conter”我们也可以在程序中找到./zibll/inc/functions/zib-footer.php

我们打开此文件,可以找到如下代码(大致在460行处):

/*板块1*/
function zib_footer_con_1()
{
    $html = '';

    if (_pz('footer_t1_img')) {
        $html .= '<p><a class="footer-logo" href="' . esc_url(home_url()) . '" title="' . _pz('hometitle') . '">
                    ' . zib_get_adaptive_theme_img(_pz('footer_t1_img'), _pz('footer_t1_img_dark'), _pz('hometitle'), 'class="lazyload" height="40"', zib_is_lazy('lazy_other', true)) . '
                </a></p>';
    }

    if (_pz('footer_t1_t')) {
        $html .= '<p class="title-h-left">' . _pz('footer_t1_t') . '</p>';
    }

    if (_pz('fcode_t1_code')) {
        $html .= '<div class="footer-muted em09">' . _pz('fcode_t1_code') .'</div>';
    }
    return $html;
}
/*板块2*/
function zib_footer_con_2()
{
    ...
}
/*板块3*/
function zib_footer_con_2()
{
    ...
}

该位置代码所对应的主题后台位置:Zibll主题这只->页面&显示->底部页脚

function zib_footer_con_1() //对应板块一设置

function zib_footer_con_2() //对应板块二设置

function zib_footer_con_3() //对应板块三设置

对应的后台设置位置,我们以修改板块二中的第二行为例:

zibfooterxiugai.png

如上图所示:在第二行中,我只需要填写 建站年份,备案号,主站地址,主站名称

按照这个顺序以逗号”,”隔开,英文逗号.

这样就避免了以往写html代码一样,很长很长.

当然这样的配置,比较固定了,这里只是给大家一个方法,可以根据这个方法去自己修改个性底部内容.

修改后的样式如下:

电脑PC版样式
laoknasbanq.png

手机版样式:laoknasbanqian.png

以上样式并没有改动zibll原主题的样式,只是针对后台修改了填写内容方式而已.

也可以看访问 https://www.laoknas.com 网站进行预览.

修改后源码如下:

/*板块2*/
function zib_footer_con_2()
{
    $html = '';

    if (_pz('fcode_t2_code_1')) {
    	
    	
        $html .= '<p class="fcode-links">' . _pz('fcode_t2_code_1') . '</p>';
    }

    if (_pz('fcode_t2_code_2')) {
    	
    	$arr=explode(',',_pz('fcode_t2_code_2'));
    	
    	/*2020,辽ICP备2021005077号,https://laoknas.com,Laok*/

        $date=$arr[0];
        
        if ($date<date("Y"))
        
		{
			$date=$date."−".date('Y');
		}
		
	$beian ='<p><a href="https://beian.miit.gov.cn">'. $arr[1] .'</a></p>';
		
        $banquan ='<p>Copyright &copy '.$date.' <a href="'.$arr[2].'">'.$arr[3].'</a> All Rights Reserved.</p>';
        
        $html .= '<div class="footer-muted em09">'.$beian . $banquan . '</div>';
        
        /*$html .= '<div class="footer-muted em09">' . _pz('fcode_t2_code_2') . '</div>';*/
    }
    $s_src  = ZIB_TEMPLATE_DIRECTORY_URI . '/img/thumbnail-sm.svg';
    $m_show = _pz('footer_contact_m_s', true) ? '' : ' hidden-xs';
    $html .= '<div class="footer-contact mt10' . $m_show . '">';
    if ((!wp_is_mobile() || _pz('footer_contact_m_s', true)) && _pz('footer_contact_wechat_img')) {
        $lazy_attr = zib_is_lazy('lazy_other', true) ? 'class="lazyload" src="' . $s_src . '" data-' : '';

        $s_img = '';
        $s_img .= '<div class="hover-show-con footer-wechat-img">';
        $s_img .= '<img style="box-shadow: 0 5px 10px rgba(0,0,0,.2); border-radius:4px;" height="100" ' . $lazy_attr . 'src="' . _pz('footer_contact_wechat_img') . '" alt="扫一扫加微信' . zib_get_delimiter_blog_name() . '">';
        $s_img .= '</div>';

        $html .= '<a class="toggle-radius hover-show nowave" href="javascript:;">' . zib_get_svg('d-wechat') . $s_img . '</a>';
    }
    if (_pz('footer_contact_qq')) {
        $html .= '<a class="toggle-radius" data-toggle="tooltip" target="_blank" title="QQ联系" href="http://wpa.qq.com/msgrd?v=3&uin=' . _pz('footer_contact_qq') . '&site=qq&menu=yes">' . zib_get_svg('d-qq', '-50 0 1100 1100') . '</a>';
    }
    if (_pz('footer_contact_weibo')) {
        $html .= '<a class="toggle-radius" data-toggle="tooltip" title="微博" href="' . _pz('footer_contact_weibo') . '">' . zib_get_svg('d-weibo') . '</a>';
    }
    if (_pz('footer_contact_email')) {
        $html .= '<a class="toggle-radius" data-toggle="tooltip" title="发邮件" href="mailto:' . _pz('footer_contact_email') . '">' . zib_get_svg('d-email', '-20 80 1024 1024') . '</a>';
    }
    $html .= '</div>';
    return $html;
}

 

请登录后发表评论

    没有回复内容