Many of the behaviors observed in actual systems are comparable to scale-free and small world structures in network research. In contrast to conventional hierarchical networks, the unusual fractal hierarchical network we created in this research has a pyramidal structure. The findings we get from this network are expanded to be applicable to arbitrary hierarchical networks. The average path length of unweighted and weighted hierarchical networks are the main topics of this paper. We demonstrate that, in the unweighted case, when the number of iterations z tends to infinity, the average path length is only related to the number of blocks of the hierarchical network. Additionally, in the weighted network, the average path length is related to the number of blocks r and the weighting factor w of the hierarchical network.