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 | |
$args = array( | |
'post_type' => 'services' | |
); | |
$the_query = new WP_query( $args ); | |
?> | |
<?php if ( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post() ;?> |
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
$(document).ready(function() { | |
$('.story-small img').each(function() { | |
var maxWidth = 100; // Max width for the image | |
var maxHeight = 100; // Max height for the image | |
var ratio = 0; // Used for aspect ratio | |
var width = $(this).width(); // Current image width | |
var height = $(this).height(); // Current image height | |
// Check if the current width is larger than the max | |
if(width > maxWidth){ |
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 | |
class My_Plugin_Options { | |
var $options; | |
var $option_name; | |
var $is_site_option; // Are we using Multisite and saving to global options? | |
function My_Plugin_Options($option_name, $is_site_options = false){ | |
$this->option_name = $option_name; | |
$this->is_site_option = $is_site_options; | |
if($this->is_site_option){ |
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
# Search for .ps1 files in a given directory | |
Get-ChildItem C:\Code\powershell -Include *.ps1 -Recurse -Force | % { . $_.FullName } |
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_front_page()){ ?> | |
<h1>Blog Directory</h1> | |
<?php | |
global $wpdb; | |
$aBlogs = array(); | |
$query = "SELECT blog_id FROM " . $wpdb->base_prefix . "blogs WHERE spam != '1' AND archived != '1' AND deleted != '1' AND public = '1' AND blog_id != '1' ORDER BY path"; | |
$blogs = $wpdb->get_results($query); | |
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_front_page()){ ?> | |
<h1>Blog Directory</h1> | |
<?php | |
global $wpdb; | |
$query = "SELECT blog_id FROM " . $wpdb->base_prefix . "blogs WHERE spam != '1' AND archived != '1' AND deleted != '1' AND public = '1' AND blog_id != '1' ORDER BY path"; | |
$blogs = $wpdb->get_results($query); | |
echo '<ul>'; |
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
/******************************************************** | |
* Main Body Styles | |
********************************************************/ | |
/******************************************************** | |
* Header Styles | |
********************************************************/ | |
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 | |
/* | |
Plugin Name: Create Sample Tables Plugin | |
Plugin URI: http://ericjuden.com | |
Description: Create some dummy tables | |
Version: 1.0 | |
Author: ericjuden | |
Author URI: http://ericjuden.com | |
*/ |
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 | |
// Create a new record in a table | |
global $wpdb; | |
// data to be added | |
$data = array( | |
'post_title' => __('This is a test'), | |
'post_content' => __('This is really long text'), | |
'post_status' => __('draft') |
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 | |
global $wpdb; | |
// Clean SQL before running | |
$sql = $wpdb->prepare('SELECT * FROM ' . $wpdb->posts . ' WHERE status = %s AND post_type = %s', 'publish', 'page'); | |
// Return results | |
$results = $wpdb->get_results($sql); | |
?> |
NewerOlder