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
function enable_front_page_stacks( $query ){ | |
if('' == $query->query_vars['post_type'] && 0 != $query->query_vars['page_id']) | |
$query->query_vars['post_type'] = array( 'page', 'stack' ); | |
} | |
add_action( 'pre_get_posts', 'enable_front_page_stacks' ); |
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
define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] ); | |
define('WP_HOME', 'http://' . $_SERVER['SERVER_NAME'] ); |
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
if(function_exists('acf_add_options_page')) { | |
acf_add_options_page(); | |
acf_add_options_sub_page('Header'); | |
acf_add_options_sub_page('Footer'); | |
} |
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
<?php $status = isset( $_REQUEST['subscribe'] ) ? $_REQUEST['subscribe'] : false; ?> | |
<?php if ( $status == 'invalid_email' ) : ?> | |
<p>You have entered an invalid e-mail, please try again!</p> | |
<?php elseif ( $status == 'success' ) : ?> | |
<p>Thank you for subscribing! Please check your e-mail to confirm.</p> | |
<?php else : ?> | |
<form method="POST"> | |
<input type="hidden" name="my-form-action" value="subscribe" /> | |
<input name="my-email" value="" placeholder="Enter your e-mail" /> | |
<input type="submit" /> |
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
input { | |
-webkit-appearance: none; | |
@include border-radius(0); | |
border-radius: none; | |
-webkit-border-radius:0px; | |
} |
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
function zip_gallery() | |
{ | |
global $post; | |
$images = get_children(array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_mime_type' => 'image', )); | |
if ($images) { | |
$save = $post->post_title; | |
$zip = new ZipArchive; | |
if ($zip->open($save . '.zip', ZIPARCHIVE::CREATE) === true) { |
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
function wpa60888_attachment_link( $link, $id ){ | |
return home_url() . '/?attachment_id=' . $id; | |
} | |
add_filter( 'attachment_link', 'wpa60888_attachment_link', 10, 2 ); |
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
wp_deregister_script('jquery'); | |
wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js", false, null); | |
wp_enqueue_script('jquery'); |
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
<?php | |
$gallery = get_field('images'); | |
$rand = array_rand($gallery, 1); | |
if( $gallery ): ?> | |
<img src="<?php echo $gallery[$rand]['sizes']['large']; ?>" alt="<?php echo $gallery[$rand]['alt']; ?>" /> | |
<?php endif; ?> |