【问题标题】:Modifying header.php for Avada Wordpress theme修改 Avada Wordpress 主题的 header.php
【发布时间】:2012-10-08 01:30:45
【问题描述】:

测试站点示例:http://cincinnati-website-design.net/sandbox/

我正在使用 Avada 主题,但似乎无法通过支持获得帮助。他们只是告诉我去找开发人员。

我试图让“page-title-container”出现在主索引/主页上。它在所有其他页面上都正确显示,但显然它被设计为不显示在主索引或主页上。

header.php sn-p:

<?php if(of_get_option('page_title_bar', 'yes') == 'yes'): ?>
<?php if(((is_page() || is_single() || is_singular('avada_portfolio')) && get_post_meta($post->ID, 'pyre_page_title', true) == 'yes') && !is_front_page()): ?>
<div class="page-title-container">
    <div class="page-title">
        <h1><?php the_title(); ?></h1>
        <?php kriesi_breadcrumb(); ?>
    </div>
</div>
<?php endif; ?>
<?php if(is_home() && !is_front_page() && get_post_meta($slider_page_id, 'pyre_page_title', true) == 'yes'): ?>
<div class="page-title-container">
    <div class="page-title">
        <h1><?php echo of_get_option('blog_title', 'Blog'); ?></h1>
        <?php kriesi_breadcrumb(); ?>
    </div>
</div>
<?php endif; ?>
<?php if(is_search()): ?>
<div class="page-title-container">
    <div class="page-title">
        <h1><?php _e('Search results for:', 'Avada'); ?> <?php echo get_search_query(); ?></h1>
    </div>
</div>
<?php endif; ?>
<?php if(is_archive()): ?>
<div class="page-title-container">
    <div class="page-title">
        <h1><?php single_cat_title(); ?></h1>
        <?php kriesi_breadcrumb(); ?>
    </div>
</div>
<?php endif; ?>
<?php endif; ?>
<div id="main" style="overflow:hidden !important;">
    <div class="row">

【问题讨论】:

    标签: php wordpress wordpress-theming


    【解决方案1】:

    这段代码:

    is_front_page()
    

    检查首页。

    尝试从上面的代码中删除以下内容:

    && !is_front_page()
    

    当它出现在首页时,它会出现两次,并告诉脚本不要执行后面的操作。

    【讨论】:

    • 我一定是搞错了括号什么的。试过了,但失败了。非常感谢你让我理顺!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多