Skip to content

Commit

Permalink
Updates Updates!
Browse files Browse the repository at this point in the history
- Added social media icons for easy update

- Added SVG dimensions support for uploads

- Made some small changes for items I use a lot: i.e background image
on hero, removed nav section in CSS to combine with header.
  • Loading branch information
amberweinberg committed Sep 2, 2017
1 parent 11cfb0a commit 90d0d80
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 10 deletions.
8 changes: 8 additions & 0 deletions super-hijinksified/footer.php
Expand Up @@ -3,11 +3,19 @@
<footer>
<div class="container">
<?php wp_nav_menu( array('menu' => 'Footer', 'container' => false, )); ?>

<ul class="social">
<li><a href="<?php the_field('facebook_url','option');?>" target="_blank"><i class="fa fa-facebook" aria-hidden="true"></i><span class="accessibility">Facebook</span></a></li>
<li><a href="<?php the_field('twitter_url','option');?>" target="_blank"><i class="fa fa-twitter" aria-hidden="true"></i><span class="accessibility">Twitter</span></a></li>
<li><a href="<?php the_field('instagram_url','option');?>" target="_blank"><i class="fa fa-instagram" aria-hidden="true"></i><span class="accessibility">Instagram</span></a></li>
<li><a href="<?php the_field('youtube_url','option');?>" target="_blank"><i class="fa fa-youtube" aria-hidden="true"></i><span class="accessibility">Youtube</span></a></li>
</ul>
</div>
</footer>

<!--Scripts-->

<script src="https://use.fontawesome.com/7d991d7335.js"></script>
<script src="<?php bloginfo('template_url');?>/js/script.js"></script>

<!--Warn Old Browsers To Quit Being Old-->
Expand Down
23 changes: 21 additions & 2 deletions super-hijinksified/functions.php
Expand Up @@ -57,8 +57,8 @@ function wpe_excerpt($length_callback='', $more_callback='') {
'hierarchical' => false,
'rewrite' => true,
'query_var' => false,
'has_archive' => true,
'supports' => array('title', 'editor', 'author')
'has_archive' => false,
'supports' => array('title', 'editor', 'thumbnail')
));

add_action( 'init', 'build_taxonomies', 0 );
Expand Down Expand Up @@ -99,4 +99,23 @@ function wpcontent_svg_mime_type( $mimes = array() ) {
}
add_filter( 'upload_mimes', 'wpcontent_svg_mime_type' );

add_filter( 'wp_get_attachment_image_src', 'fix_wp_get_attachment_image_svg', 10, 4 ); /* the hook */

function fix_wp_get_attachment_image_svg($image, $attachment_id, $size, $icon) {
if (is_array($image) && preg_match('/\.svg$/i', $image[0]) && $image[1] <= 1) {
if(is_array($size)) {
$image[1] = $size[0];
$image[2] = $size[1];
} elseif(($xml = simplexml_load_file($image[0])) !== false) {
$attr = $xml->attributes();
$viewbox = explode(' ', $attr->viewBox);
$image[1] = isset($attr->width) && preg_match('/\d+/', $attr->width, $value) ? (int) $value[0] : (count($viewbox) == 4 ? (int) $viewbox[2] : null);
$image[2] = isset($attr->height) && preg_match('/\d+/', $attr->height, $value) ? (int) $value[0] : (count($viewbox) == 4 ? (int) $viewbox[3] : null);
} else {
$image[1] = $image[2] = null;
}
}
return $image;
}

?>
2 changes: 1 addition & 1 deletion super-hijinksified/page-home.php
Expand Up @@ -7,7 +7,7 @@

<!--Hero-->

<section class="hero">
<section class="hero" style="background-image: url('<?php the_field('hero_background_image');?>');>
<div class="container">

</div>
Expand Down
22 changes: 15 additions & 7 deletions super-hijinksified/style.css
Expand Up @@ -71,7 +71,13 @@ h3 {

}

header, section, footer {
p {

}

header,
section,
footer {
float: left;
width: 100%;
}
Expand Down Expand Up @@ -104,12 +110,6 @@ header, section, footer {



/***************************************************************************************************************************************************************************************/

/*NAV STYLES*/

/***************************************************************************************************************************************************************************************/


/***************************************************************************************************************************************************************************************/

Expand All @@ -124,6 +124,14 @@ header, section, footer {

/***************************************************************************************************************************************************************************************/

/***Hero***/

.hero {
background: no-repeat center #000;
background-size: cover;
height: 618px;
position: relative;
}

/***************************************************************************************************************************************************************************************/

Expand Down

0 comments on commit 90d0d80

Please sign in to comment.