Skip to content

Instantly share code, notes, and snippets.

@jaygidwitz
Created June 15, 2016 18:13
Show Gist options
  • Save jaygidwitz/190ce7999c8b1b0e6961c50eb486d2ce to your computer and use it in GitHub Desktop.
Save jaygidwitz/190ce7999c8b1b0e6961c50eb486d2ce to your computer and use it in GitHub Desktop.
Home Box Shortcode
// Add homebox Shortcode
function homebox_shortcode( $atts , $content = null ) {
// Attributes
extract( shortcode_atts(
array(
'boxclass' => '',
'link' => '',
'title' => '',
'img' => '',
), $atts )
);
// Code
return '<div class="boxxx"><a href="' . $link . '">
<div class="homeboxes ' . $boxclass . '" style="background: url(' . $img . ') no-repeat center;">
<div class="boxcontent">
<div class="box-title"><h1 class="title-lined">' . $title .'</h1></div>
' . $content . '
</div>
</div>
</a></div>';
}
add_shortcode( 'homebox', 'homebox_shortcode' );
/* Homepage 3 Boxes
This was written a long time ago...
--------------------------------------------- */
div.homeboxes {
width: 31.333333333333336%;
float: left;
border-radius: 6px;
-webkit-box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.2);
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.2);
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin-bottom: 1em;
overflow: hidden;
position: relative;
height: 414px;
margin: 0 1%;
}
@media screen and (max-width: 800px) {
div.homeboxes {
float: none;
width: 91%;
margin: 1em auto;
max-width: 359px;
}
.home-section-2 .textwidget .boxxx {
max-width: 359px;
max-height: 380px;
margin: 0 auto;
}
}
.homeboxes h1.title-lined {
text-transform: none;
}
.homeboxes .hide {
display: none;
}
.homeboxes:hover .hide {
display: block;
}
@media screen and (max-width: 1024px) {
.homeboxes:hover .hide {
display: none;
}
}
.homeboxes img.small {
width: 39%;
height: 39%;
}
.homeboxes img.title-lined {
}
img.title-lined:before {
margin-left: -50%;
right: .5em;
}
img.title-lined:after {
left: .5em;
margin-right: -50%;
}
img.title-lined:before,
img.title-lined:after {
background-color: #fcca76;
content: '';
display: inline-block;
height: 2px;
position: relative;
top: -4px;
vertical-align: middle;
width: 50%;
}
.boxleft,
a .boxleft {
background-color: #b2deee;
background: url(http://squibbs.studioissa.com/wp-content/themes/squibbs-pd/images/our-story.jpg) no-repeat center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
color: white;
}
.boxleft p {
padding: 18px 24px;
}
.boxleft:hover {
background-color: #68a7bd;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
color: white;
}
.boxcenter {
background: url(http://squibbs.studioissa.com/wp-content/themes/squibbs-pd/images/recipes.jpg) no-repeat center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-color: #b2deee;
}
.boxcenter:hover {
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-color: #b2deee;
}
.boxcenter h2 {
color: #002b5c;
padding: 24px 24px 0;
font-size: 22px;
}
.boxcenter p {
padding: 0;
color: #002b5c;
font-size: 40%;
}
.boxcenter img {
padding: 0 auto;
float: none;
color: #002b5c;
font-size: 70%;
clear: both;
margin: 0 auto;
}
.boxcenter p:hover {
padding: 0;
color: #fcca76;
}
.boxcenter:hover {
background-color: #68a7bd;
}
h2.grey {
color: #555;
}
h2.strong {
font-weight: bolder;
}
section#text-15 {
background: url("http://squibbs.studioissa.com/wp-content/uploads/2014/05/1015204_10151740011248530_1581506400_o-1-e1400550892777.jpg");
background-attachment: fixed;
background-color: #fff;
background-position: center center;
background-repeat: no-repeat;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
}
#text-15 .widget-wrap .textwidget {
padding: 50px;
text-align: center;
font-size: 32px;
color: white;
}
/* Android(Samsung Galaxy) in portrait 380 X 685 to samsung galaxy 3 ----------- */
@media only screen and (min-width: 200px) and (max-width: 721px) {
#text-15 .widget-wrap .textwidget {
padding: 50px 15px;
}
}
/* Android(Samsung Galaxy) in portrait 380 X 685 to samsung galaxy 3 ----------- */
@media only screen and (min-width: 375px) and (max-width: 721px) and (-webkit-min-device-pixel-ratio: 3) {
#text-15 {
min-height: 450px;
}
}
/* Android(Samsung Galaxy) in portrait 380 X 685 to samsung galaxy 3 ----------- */
@media only screen and (-webkit-min-device-pixel-ratio: 3) {
#text-15 .widget-wrap .textwidget {
padding: 50px 15px;
}
}
#text-15 img {
height: 60px;
width: 60px;
}
section#text-15 h3 {
color: white;
text-transform: uppercase;
}
.boxright {
background: url("http://squibbs.studioissa.com/wp-content/themes/squibbs-pd/images/hashtag-grannysquibbs.jpg");
background-color: #b2deee;
}
.boxright:hover {
/* background: url("http://squibbs.studioissa.com/wp-content/themes/squibbs-pd/images/hashtag-grannysquibbs-hover.jpg");*/
transition: none;
background-color: #68a7bd;
}
.homeboxes .boxcontent {
background-color: #fff;
bottom: 0;
height: 104px;
left: 0;
position: absolute;
text-align: center;
padding: 26px 24px;
}
.boxcontent {
transition: height .25s ease-out;
}
.boxcontent {
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
color: #002b5c;
line-height: 1.2;
padding: 18px 24px;
width: 100%;
}
.homeboxes p.ptext {
display: none;
font-size: .7em;
margin-top: 1em;
color: #88bce4;
}
.homeboxes:hover p.ptext {
display: inline-block;
font-size: 85%;
color: #002b5c;
}
@media screen and (max-width: 1024px) {
.homeboxes:hover p.ptext {
display: none;
}
}
img.thirty {
width: 100px;
margin: 0 auto;
float: none;
}
.boxright .ptext {
margin-top: 0;
}
.boxright .grey.strong {
margin: 0 auto;
}
.homeboxes:hover .boxcontent {
background: #fff;
color: #51595b;
height: 100%
}
@media screen and (max-width: 1024px) {
.homeboxes:hover .boxcontent {
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
color: #002b5c;
line-height: 1.2;
padding: 18px 24px;
width: 100%;
background-color: #fff;
bottom: 0;
height: 104px;
left: 0;
position: absolute;
text-align: center;
padding: 26px 24px;
}
.boxright .grey.strong {
display: none;
}
div.homeboxes {
height: 380px;
}
}
@media screen and (max-width: 940px) {
div.homeboxes {
height: 360px;
}
}
@media screen and (max-width: 880px) {
div.homeboxes {
height: 340px;
}
}
.touch .homeboxes:hover .boxcontent {
background-color: #FFF;
bottom: 0px;
height: 104px;
left: 0px;
position: absolute;
text-align: center;
padding: 26px 24px;
}
@media screen and (max-width: 1040px) and (min-width: 801px) {
div.homeboxes div.box-title {
font-size: 20px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment