This file contains hidden or 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
<?php | |
/* | |
* Add recent posts shortcode. Use like so: [recent-posts posts='5' slug='uncategorized'] | |
*/ | |
function recent_posts_function($atts){ | |
extract(shortcode_atts(array( | |
'posts' => 5, | |
'slug' => 'uncategorized' | |
), $atts)); |
This file contains hidden or 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
jQuery(function($) { | |
var scrollElement = 'html, body'; | |
$("a[href^='#']").click(function(event) { | |
event.preventDefault(); | |
var $this = $(this), | |
target = this.hash, |
This file contains hidden or 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
<?php | |
$page_id = 5; | |
$page_data = get_page( $page_id ); | |
$content = apply_filters('the_content', $page_data->post_content); | |
$title = $page_data->post_title; | |
echo $content; | |
?> |
This file contains hidden or 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
<?php $img = get_field('FIELD_NAME_HERE'); if($img): ?> | |
<img src="<?php echo $img['url']; ?>" alt="<?php echo $img['alt']; ?>"> | |
<?php endif; ?> |
This file contains hidden or 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
<?php | |
if(get_field('gallery')): | |
echo '<div class="gallery__images">'; | |
$i == 0; | |
while(has_sub_field('gallery')): | |
$i++; | |
$parent_image = get_sub_field('parent_image'); | |
echo '<div class="gallery_inner_image">'; | |
echo '<div class="holder">'; |
This file contains hidden or 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
<a href="https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=<?php the_permalink() ?>" download="QRCode">Download this Code</a> | |
<div id="qrcode"></div> | |
<script type="text/javascript"> | |
var img = document.createElement('img'); | |
img.src = 'https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=' + encodeURIComponent(document.location.href); | |
This file contains hidden or 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
//To use PHP code in a text widget (useful for links and conditionals), place this code in your theme's functions.php file. | |
add_filter('widget_text', 'php_text', 99); | |
function php_text($text) { | |
if (strpos($text, '<' . '?') !== false) { | |
ob_start(); | |
eval('?' . '>' . $text); | |
$text = ob_get_contents(); |
This file contains hidden or 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
.tabs{ | |
margin: {top:40px;} | |
&:last-child{ | |
margin: {bottom:80px;} | |
} | |
h2{ | |
color: $color-1; | |
font: { | |
size: emCalc(36px); | |
} |
This file contains hidden or 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
/* | |
* Custom Comments | |
* Description: Use custom comments (overrides wp_list_comments like so: <?php wp_list_comments('type=comment&callback=mytheme_comment'); ?>) | |
*/ | |
function mytheme_comment($comment, $args, $depth) { | |
$GLOBALS['comment'] = $comment; | |
extract($args, EXTR_SKIP); | |
if ('div' == $args['style']) { | |
$tag = 'div'; | |
$add_below = 'comment'; |
This file contains hidden or 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
<?php $the_query = new WP_Query('cat=3&posts_per_page=2'); ?> | |
<?php if ($the_query->have_posts()) : ?> | |
<?php while ($the_query->have_posts()) : $the_query->the_post(); ?> | |
output... | |
<?php endwhile; wp_reset_postdata();?> | |
<?php endif; ?> |
NewerOlder