Skip to content

Instantly share code, notes, and snippets.

@aslamahamed13
Last active September 10, 2018 15:51
Show Gist options
  • Save aslamahamed13/7bfd30b33883dfc75a27fec783882b38 to your computer and use it in GitHub Desktop.
Save aslamahamed13/7bfd30b33883dfc75a27fec783882b38 to your computer and use it in GitHub Desktop.
Adding background image in home-v2
if( ! function_exists( 'pizzaro_home_v2_hook_control' ) ) {
function pizzaro_home_v2_hook_control() {
if( is_page_template( array( 'template-homepage-v2.php' ) ) ) {
remove_action( 'pizzaro_homepage_v2', 'pizzaro_revslider_v2', isset( $home_v2['sdr']['priority'] ) ? intval( $home_v2['sdr']['priority'] ) : 20 );
add_action( 'pizzaro_homepage_v2', 'pizzaro_v2_background_image', isset( $home_v2['sdr']['priority'] ) ? intval( $home_v2['sdr']['priority'] ) : 20 );
}
}
}
if ( ! function_exists( 'pizzaro_v2_background_image' ) ) {
/**
* Displays site logo in header
*/
function pizzaro_v2_background_image() {
?><header class="custom-pz section-product">
<div class="section-input-inner">
<h3 class="input-top-text">The #1 Selection of Foods in Caribbean</h3>
<h2 class="input-title">SEARCH FOR FOOD AND RESTUARANT</h2>
<form role="search" method="get" class="woocommerce-product-search-1" action="http://localhost/~ibrahim/pizzaro/">
<label class="screen-reader-text" for="woocommerce-product-search-field-0">Search for:</label>
<input type="search" id="woocommerce-product-search-field-1" class="search-field" placeholder="eg.shushi,pizza,chowmein,salad,fried chicken" value="" name="s">
<button type="submit" value="Search">Find Food</button>
<input type="hidden" name="post_type" value="product">
</form>
<h3 class="input-bottom-text">or browse from our most popular selection</h3>
</div>
</header><?php
}
}
.custom-pz {
background-image: url(https://placeholdit.co//i/1920x600?&bg=EBEBEC);height: 525px;background-size: cover;background-position: center center;display: flex;justify-content: center;align-items: center;
}
.custom-pz .woocommerce-product-search-1 {
display: flex; justify-content: center; margin-bottom: 60px;
}
.custom-pz input#woocommerce-product-search-field-1 {
border-radius: 1px; width: 70%;
}
.custom-pz .section-input-inner {
z-index: 2;text-align: center;
}
.custom-pz .input-title {
margin-bottom: 50px;color: #fff;
}
.custom-pz .input-bottom-text{
font-size: 24px;color: #fff;
}
.custom-pz .input-top-text {
color: #fff; margin-bottom: 27px; font-size: 18px;
}
.custom-pz button {
border-radius: 0;padding: 13px; background-color: #c00a27;
}
.header-v2 .site-header-wrap {
display: none;
}
@media (max-width: 767px) {
.custom-pz .woocommerce-product-search-1 {
flex-wrap: wrap;
margin: 0 15px 60px;
}
.custom-pz input#woocommerce-product-search-field-1 {
margin-bottom: 15px;
width: 100%;
}
.custom-pz button {
width: 100%;
padding: 8px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment