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
before_filter :httpauth | |
private | |
def httpauth | |
authenticate_or_request_with_http_basic do |user, password| | |
user == 'userName' && password == 'crazyLongPassword1234' | |
end | |
end |
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
$xml_string = 'http://domain.com/sitemap.xml'; | |
//load the xml string using simplexml | |
$xml = simplexml_load_file($xml_string); | |
//loop through the each node of user | |
$results = array(); | |
foreach($xml->url as $url){ |
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 $loop = new WP_Query( array( 'post_type' => 'custom_post_type_name', 'posts_per_page' => 100 ) ); ?> | |
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?> | |
<div class="post"> | |
<?php the_post_thumbnail(); ?> | |
<div class="postInfo"> | |
<h3 class="lgr"><?php the_title() ?></h3> | |
<a href="<?php the_permalink() ?>">Read More</a> | |
</div> | |
</div> | |
<?php endwhile; ?> |
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 | |
function get_rounded_number_of_posts() { | |
$count_posts = wp_count_posts(); | |
$numposts = $count_posts->publish; | |
if (strlen($numposts)<3) { | |
$numposts = $numposts; | |
} else { | |
$numposts=substr($numposts, 0, strlen($numposts)-2) . "00"; | |
} | |
return $numposts; |
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 | |
if ( is_page('about-us') || '3' == $post->post_parent ) { | |
// Do Something SPECIFIC Here | |
} else { | |
// Handle Everything Else Here | |
} | |
?> |
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 | |
function as_custom_logo() { | |
echo ' | |
<style type="text/css"> | |
#header-logo { background-image: url('.get_bloginfo('template_directory').'/images/myIcon.png) !important; } | |
</style> | |
'; | |
} |
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 | |
add_filter( 'widget_tag_cloud_args', 'my_widget_tag_cloud_args' ); | |
function my_widget_tag_cloud_args( $args ) { | |
$args['number'] = 20; | |
$args['largest'] = 9; | |
$args['smallest'] = 9; | |
$args['unit'] = 'px'; | |
$args['exclude'] = array(20, 80); | |
return $args; |
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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
*/ | |
$args = array( |
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
// Hide the Barley Icon by default | |
// Show the Barley Icon on ESC Key Press | |
// Make sure DOM is loaded | |
document.addEventListener('DOMContentLoaded', function(){ | |
// The Barley Icon Element | |
var barleybar = document.getElementById('barley-bar'); | |
// Hide By Default |
OlderNewer