admin管理员组文章数量:1334957
Is it possible to add a button, svg and extra text paragraph to header image on the twentyseventeen theme? This is an example of what look I'm trying to achieve .png and where it sits currently .37.07%20PM.png.
I'm guessing in involves PHP to the site-branding file, but not really sure.
Thanks for the help!
Is it possible to add a button, svg and extra text paragraph to header image on the twentyseventeen theme? This is an example of what look I'm trying to achieve https://github/ppass5/Childtheme_example_images/blob/master/Hero.png and where it sits currently https://github/ppass5/Childtheme_example_images/blob/master/Screen%20Shot%202018-08-20%20at%207.37.07%20PM.png.
I'm guessing in involves PHP to the site-branding file, but not really sure.
Thanks for the help!
Share Improve this question edited Aug 21, 2018 at 16:22 Aurovrata 1,34611 silver badges18 bronze badges asked Aug 20, 2018 at 23:45 user149088user149088 112 bronze badges1 Answer
Reset to default 1I'm guessing in involves PHP to the site-branding file, but not really sure.
yes it does. You to create a child theme based on the twentyseventeen theme, and add create a new custom header.php file with the modifications you need, in order to style your header. Your custom twenty seventeen header file would look something like,
<?php
/**
* The header for our theme
*
* This is the template that displays all of the <head> section and everything up until <div id="content">
*
* @link https://developer.wordpress/themes/basics/template-files/#template-partials
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.0
*/
?><!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js no-svg">
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg/xfn/11">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id="page" class="site">
<a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'twentyseventeen' ); ?></a>
<header id="masthead" class="site-header" role="banner">
<?php get_template_part( 'template-parts/header/header', 'image' ); ?>
<?php if ( has_nav_menu( 'top' ) ) : ?>
<div class="navigation-top">
<div class="wrap">
<?php get_template_part( 'template-parts/navigation/navigation', 'top' ); ?>
</div><!-- .wrap -->
</div><!-- .navigation-top -->
<?php endif; ?>
<button>
<!-- your custom button -->
</button>
</header><!-- #masthead -->
<?php
/*
* If a regular post or page, and not the front page, show the featured image.
* Using get_queried_object_id() here since the $post global may not be set before a call to the_post().
*/
if ( ( is_single() || ( is_page() && ! twentyseventeen_is_frontpage() ) ) && has_post_thumbnail( get_queried_object_id() ) ) :
echo '<div class="single-featured-image-header">';
echo get_the_post_thumbnail( get_queried_object_id(), 'twentyseventeen-featured-image' );
echo '</div><!-- .single-featured-image-header -->';
endif;
?>
<div class="site-content-contain">
<div id="content" class="site-content">
Notice the place where I have inserted a custom button with the html comment <!-- your custom button -->
本文标签: How to insert a Button or custom text on twentyseventeen header
版权声明:本文标题:How to insert a Button or custom text on twentyseventeen header 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742312929a2451239.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论