Wordpress通用页眉页脚覆盖站点导航&页脚

时间:2016-03-09 21:55:56

标签: php wordpress azure themes

在Azure托管的Wordpress网站上,我必须使用通用页眉/页脚(UHF),它在激活时会覆盖站点页眉/页脚。

我需要网站原始导航并添加Footer代码才能运行。

这些是README.md说明:

主题整合

配置UHF后,需要在您网站的主题内进行细微更改:

首先将主题的当前标头包装在Microsoft\UHF\is_active()条件语句中。此辅助方法将确定是否为当前站点配置并激活UHF。同时,您现有的代码将位于条件的else部分,如果UHF被停用,您的网站的当前功能将保持不变。

示例:

<?php if ( function_exists( '\Microsoft\UHF\is_active' ) && \Microsoft\UHF\is_active() ) : ?>

    <?php \Microsoft\UHF\get_header(); ?>

<?php else : ?>

    <!-- Your original header -->

<?php endif; ?>

请注意,UHF标题应该是<body>元素下的第一个标题,但会替换现有的<head>元素!

页脚替换将类似:

<?php if ( function_exists( '\Microsoft\UHF\is_active' ) && \Microsoft\UHF\is_active() ) : ?>

    <?php \Microsoft\UHF\get_footer(); ?>

<?php else : ?>

    <!-- Your original footer -->

<?php endif; ?>

1 个答案:

答案 0 :(得分:2)

提供的代码示例显示如何替换使用UHF的页眉和页脚(当功能被激活时),但是如果您需要UHF页眉和/或页脚您的原始页眉/页脚,您可以调整条件语句,例如:

import numpy as np                                                   
import re                                                            
import operator                                                      

# reading lines 
file=open('matching.txt','r')  
i = 0 
temp = [] # temp is a buffer used to remember the previous lines
for line in file: # for each line 
    res = list(map(int, line.split())) # res = [v1, v2, v3]
    temp.append(res)                   # adding res, so temp = [..... [v1, v2, v3]]

    if i % 4 == 3:  
        # each fourth line (the algorithm will do 0 1 2 3 4 5 6 7 8 ...) 
        # and i%4 = 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 ...
        # now, temp= [[v1, v2, v3], [v4, v5, v6], ...]
        print(np.matrix(temp)) # convert array of array to matrix
        temp= []


    i += 1 

来源:我写了插件。

相关问题