Created
April 27, 2017 08:44
-
-
Save corilam/fd27b0eed44b05120aceec17836742ac to your computer and use it in GitHub Desktop.
Wordpress useful snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Site URL | |
<?php get_site_url(); ?> | |
// Dynamic Footer Date | |
<?php the_date('Y'); ?> | |
// Featured Image as Background Image | |
<style>.project-card-image{width:200px;height:200px;background-position:center}</style> | |
<?php $projectbg = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'home-campaigns' );?> | |
<div class="project-card-image" style="background-image: url('<?php echo $projectbg['0'];?>');"></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment