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 | |
/** | |
* 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 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
//*** Article from http://wp.tutsplus.com/tutorials/creative-coding/writing-custom-queries-in-wordpress/ | |
//The query function needs a string containing the custom query. The returnng value is an integer corresponding //to the number of rows affected/selected, and false when there is an error. | |
$query = "SELECT COUNT(apple) FROM fruits"; | |
$wpdb->query($query); | |
//This function gets multiple rows when executing a query. By default the result of the function is an array. | |
$query = " | |
SELECT * |
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 | |
//Set the Visual Editor Width Relative to Your Themes Content Width | |
add_action( 'after_setup_theme', 'wptuts_theme_setup' ); | |
function wptuts_theme_setup() { | |
set_user_setting( 'dfw_width', 1000 );//In this example the full width will be 1000 pixels. | |
} | |
add_action( 'after_setup_theme', 'wptuts_theme_setup' ); | |
function wptuts_theme_setup() { |
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
$('#digital_element').change(function() { | |
alert($(this).val()); | |
}); |
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
//Add mineType | |
add_filter('upload_mimes','add_custom_mime_types'); | |
function add_custom_mime_types($mimes){ | |
return array_merge($mimes,array ( | |
'ac3' => 'audio/ac3', | |
'mpa' => 'audio/MPA', | |
'flv' => 'video/x-flv' | |
)); | |
} |
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
git branch -D BRANCH_NAME | |
git push origin :BRANCH_NAME |
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
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js" type="text/javascript" charset="utf-8"></script> | |
$("#freeform").validate({ | |
submitHandler: function() { | |
$.ajax({ | |
url: "URL", | |
type: 'POST', | |
dataType: 'html', | |
data: ({ |
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
//Just paste the following code on your functions.php file | |
function email_members($post_ID) { | |
global $wpdb; | |
$usersarray = $wpdb->get_results("SELECT user_email FROM $wpdb->users;"); | |
$users = implode(",", $usersarray); | |
mail($users, SUBJECT, CONTENT); | |
return $post_ID; | |
} |
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
//Function for showing lastest post within cat_id | |
function imediapixel_latestnews($blogcat,$num=4,$title="") { | |
global $post; | |
echo $title; | |
if(is_array($blogcat)) { | |
$blog_includes = implode(",",$blogcat); | |
} else { | |
$blog_includes = $blogcat; |
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
/* Breadcrumbs Navigation */ | |
function imediapixel_breadcrumbs() { | |
$delimiter = '»'; | |
$name = __('Home','ecobiz'); //text for the 'Home' link | |
$currentBefore = '<span class="current">'; | |
$currentAfter = '</span>'; | |
if ( !is_home() && !is_front_page() || is_paged() ) { | |
OlderNewer