首页 > 解决方案 > 如何在页面顶部放置文本块?

问题描述

我想把这个“文本块”放在页面顶部的后面栏(见图)。我该怎么做呢?我将该部分放在所有内容上,但突出显示的(图片中)文本不会放在顶部。

提前致谢

在此处输入图像描述

这是我目前拥有的代码

get_header();
while ( have_posts() ) : the_post();
    get_template_part( 'blocks/top', 'block' );
    
    $contact_html = '';
    $phone = get_field('phone');
    if($phone){
        $call_phone = call_phone($phone);
        $contact_html .= '<li><a href="tel:'. $call_phone .'">'. $phone .'</a></li>';
    }
    $email = antispambot(get_field('email'));
    if($email){
        $contact_html .= '<li><a href="mailto:'. $email .'">'. $email .'</a></li>';
    }
    $chat_link = get_field('chat_link');
    if($chat_link){
        $contact_html .= '<li><a href="'. $chat_link .'">'. __('Chat with us') .'</a></li>';
    }
    $distributor_page_url = get_field('distributor_page_url');
    if($distributor_page_url){
        $contact_html .= '<li><a href="'. $distributor_page_url .'">'. __('distributor locations') .'</a></li>';
    }
    $text_block = get_field('text_block');
    $locations = get_field('locations');
    ?>
        <div class="container width-1130">
            <div class="text-block">
                <?php echo $text_block; ?>
            </div>
    </section>
    <?
?>

<section class="section-over-top-bg section-contact">
    <div class="container width-1130">
        <?php if($contact_html): ?>
            <ul class="contact-list d-flex justify-content-between align-items-center f-d-column-520">
                <?php echo $contact_html; ?>
            </ul>
        <?php endif; ?>

        <div>
 <script type="text/javascript" id="aoform-script-d225dfc1-a9ea-47cc-bfe8-080e93dc5922:</script>
        </div>
    </div>
</section>

标签: phphtmlwordpress

解决方案


推荐阅读