gpt4 book ai didi

html - WordPress - 将按钮添加到标题区域

转载 作者:太空宇宙 更新时间:2023-11-04 01:02:17 25 4
gpt4 key购买 nike

我正在尝试使用自定义按钮实现以下目标:

桌面:

手机:

请让我知道如何在我的 WordPress 网站上进行此操作。我想用这个按钮实现的是:在桌面上,按钮总是显示。在移动设备上,该按钮始终显示在三行菜单旁边。此时,我的网站在移动端的三行菜单中显示蓝色按钮。我希望此按钮始终显示在此菜单之外的 3 行菜单旁边,如上所示。谢谢!

感谢您的帮助。

最佳答案

这是在移动端修改标题的代码:

<?php
$scroll_trigger = get_option('stack_scroll_trigger', '200px');
$mobile_scroll_trigger = get_option('stack_mobile_scroll_trigger', '200px');
$scroll = ( 'yes' == get_option('stack_scroll_header', 'yes') ) ? 'data-scroll-class="'. $scroll_trigger .':pos-fixed"' : false;
$mobile_scroll = ( 'yes' == get_option('stack_scroll_mobile_header', 'yes') ) ? 'data-scroll-class="'. $mobile_scroll_trigger .':pos-fixed"' : false;
$mobile_scroll_class = ( 'yes' == get_option('stack_scroll_mobile_header', 'yes') ) ? 'bar--mobile-sticky' : false;

$background = get_option('stack_header_background', 'original--bg');
?>

<div class="nav-container">

<div class="bar bar--sm visible-xs <?php echo esc_attr($background); ?> <?php echo esc_attr($mobile_scroll_class); ?>" <?php echo wp_kses_post($mobile_scroll); ?>>
<div class="container">
<div class="row">
<div class="col-xs-4 col-sm-10">
<?php get_template_part('inc/content-header', 'logo'); ?>
</div>
<div class="col-xs-8 col-sm-2 text-right mobile-header">
<?php
if( class_exists('woocommerce') && 'yes' == get_option('stack_header_mobile_cart', 'yes') ){
get_template_part('inc/content-header', 'woocommerce');
}
?>
<a class="hidden-md hidden-lg btn btn--sm btn--primary type--uppercase" href="#" target="">
<span class="btn__text">become a technician</span>
</a>
<a href="#" class="hamburger-toggle" data-toggle-class="#menu1;hidden-xs">
<i class="icon--sm stack-interface stack-menu"></i>
</a>
</div>
</div><!--end of row-->
</div><!--end of container-->
</div><!--end bar-->

<nav id="menu1" class="bar bar--sm bar-1 hidden-xs hiddem-sm bar--transparent bar--absolute <?php echo esc_attr($background); ?>" <?php echo wp_kses_post($scroll); ?>>
<div class="container">
<div class="row">
<div class="col-md-1 col-sm-2 hidden-xs">
<div class="bar__module">
<?php get_template_part('inc/content-header', 'logo'); ?>
</div><!--end module-->
</div>
<div class="col-md-11 col-sm-12 text-right text-left-xs text-left-sm">
<?php get_template_part('inc/content-header', 'nav'); ?>
<?php get_template_part('inc/content-header', 'buttons'); ?>
</div>
</div><!--end of row-->
</div><!--end of container-->
</nav><!--end bar-->

</div>

enter image description here

关于html - WordPress - 将按钮添加到标题区域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53006409/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com