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
/* =============================================== | |
--------- Custom Login Screen -------------- | |
================================================== */ | |
add_action("login_head", "sepiaLogin"); | |
function sepiaLogin() { | |
project_admin_css(); | |
} | |
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
/*----------- Print Stylesheet -------------*/ | |
/* ===================================== | |
Print Stylesheet and script from | |
my theme folder to Admin Panel | |
=======================================*/ | |
add_action("admin_init", "custom_post_assets"); | |
function custom_post_assets() { | |
global $post_type; |
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 str_lreplace($needle, $replace, $haystack) | |
{ | |
/* | |
int strrpos ( string $haystack , string $needle [, int $offset = 0 ] ) | |
Find the numeric position of the last occurrence of needle in the haystack string. | |
*/ | |
$pos = strrpos($haystack, $needle); | |
if($pos !== false) | |
{ | |
$subject = substr_replace($haystack, $replace, $pos, strlen($needle)); |
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 improved_trim_excerpt($text) { | |
global $post; | |
if ( '' == $text ) { | |
$text = get_the_content(''); | |
$text = apply_filters('the_content', $text); | |
$text = str_replace('\]\]\>', ']]>', $text); | |
$text = preg_replace('@<script[^>]*?>.*?</script>@si', '', $text); | |
$text = strip_tags($text, '<p>'); | |
$excerpt_length = 80; | |
$words = explode(' ', $text, $excerpt_length + 1); |
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 | |
$args = array( | |
'post_type'=> 'services', | |
'areas' => 'painting', | |
'order' => 'ASC' | |
); | |
$the_query = new WP_Query( $args ); | |
if($the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); |
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 - Checks child subset to enable widget in sidebar | |
-------------------------------------------------- */ | |
function has_page_child_set( $page_check ) { | |
global $post; | |
//global $page_check; | |
//$page_check = $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
<?php | |
$alt = get_post_meta($attachment->ID, '_wp_attachment_image_alt', true); | |
$image_title = $attachment->post_title; | |
$caption = $attachment->post_excerpt; | |
$description = $image->post_content; | |
//$img_path = wp_get_attachment_image_src(get_post_thumbnail_id( $post->ID ),'full') ; | |
?> |
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
// <url><posttype_slug><taxonomy> | |
function my_custom_post_work() { | |
$labels = array( | |
'name' => _x( 'Work', 'post type general name' ), | |
'singular_name' => _x( 'Work', 'post type singular name' ), | |
'add_new' => _x( 'Add New', 'book' ), | |
'add_new_item' => __( 'Add New Work' ), | |
'edit_item' => __( 'Edit Work' ), | |
'new_item' => __( 'New Work' ), | |
'all_items' => __( 'All Work' ), |
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
// map: an instance of google.maps.Map object | |
// latlng: an array of google.maps.LatLng objects | |
// latlng: needs lat, long as interger , so must parse them to interger first. | |
var latlngbounds = new google.maps.LatLngBounds(); | |
for (var i = 0; i < latlng.length; i++) { | |
latlngbounds.extend(latlng[i]); | |
} | |
map.fitBounds(latlngbounds); |