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 wps_admin_bar() { | |
global $wp_admin_bar; | |
$wp_admin_bar->remove_menu('wp-logo'); | |
$wp_admin_bar->remove_menu('about'); | |
$wp_admin_bar->remove_menu('wporg'); | |
$wp_admin_bar->remove_menu('documentation'); | |
$wp_admin_bar->remove_menu('support-forums'); | |
$wp_admin_bar->remove_menu('feedback'); | |
$wp_admin_bar->remove_menu('view-site'); | |
} |
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
//You probably know that WordPress can schedule events. | |
// In this recipe, I’ll show you how you create an event that will be executed once hourly, or daily, etc. | |
if (!wp_next_scheduled('my_task_hook')) { | |
wp_schedule_event( time(), 'hourly', 'my_task_hook' ); | |
} | |
add_action( 'my_task_hook', 'my_task_function' ); | |
function my_task_function() { | |
wp_mail('[email protected]', 'Automatic email', 'Hello, this is an automatically scheduled email from WordPress.'); |
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
/* Posts List base on category*/ | |
function imediapixel_postslist($category, $num, $orderby="date",$style="2col") { | |
global $post; | |
$category_id = get_cat_ID($category); | |
$cat_num = ($num) ? $num : 4; | |
$counter = 0; | |
$out = ""; | |
query_posts('cat='.$category_id.'&showposts='.$cat_num.'&orderby='.$orderby); |
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
/* Page with child pages List */ | |
function imediapixel_pagelist($page_name, $num, $orderby="menu_order",$style="2col") { | |
global $post; | |
$page_id = get_page_by_title($page_name); | |
$services_num = ($num) ? $num : 4; | |
$counter = 0; | |
$out = ""; | |
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() ) { | |
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
//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
<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
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
//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' | |
)); | |
} |