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
// Custom Template Inheritance ----------------------------- | |
function custom_template_override () { | |
if( is_page() ) { | |
global $post; | |
if( $post->post_parent ) { | |
$parent_page_template = get_post_meta($post->post_parent,'_wp_page_template',true); | |
$current_page_template = get_post_meta($post->ID, '_wp_page_template' , true ); | |
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
// Body Class | |
function add_body_class( $classes ) | |
{ | |
global $is_iphone; | |
global $post; | |
if ( isset( $post ) ) { | |
$classes[] = $post->post_type . '-' . $post->post_name; | |
} | |
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
$pageID = 'page name or slug'; | |
get_ID_by_slug($pageID ); | |
// page id by slug | |
function get_ID_by_slug($page_slug) { | |
$page = get_page_by_path($page_slug); | |
if ($page) { | |
return $page->ID; | |
} else { |
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
// Enqueue Styles | |
function load_styles() { | |
wp_enqueue_style('AD-Gallery', $this->plugin_url . 'css/ad-gallery.css', false, '', 'screen'); | |
wp_enqueue_style('jScrollPane', $this->plugin_url . 'css/jScrollPane.css', false, '', 'screen'); | |
} | |
// Enqueue Scripts | |
function load_scripts() { |
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
/* GET THUMBNAIL URL */ | |
function get_image_url(){ | |
$image_id = get_post_thumbnail_id(); | |
$image_url = wp_get_attachment_image_src($image_id,'large'); | |
$image_url = $image_url[0]; | |
echo $image_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
// Shortcode for recent post | |
add_shortcode('ss_recentpost','ss_recent_post'); | |
// add_filter('the_content', 'do_shortcode', 11); | |
add_filter('widget_text', 'do_shortcode'); | |
function ss_recent_post($attr) { |
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
/* FEATURED THUMBNAILS */ | |
if ( function_exists( 'add_theme_support' ) ) { // Added in 2.9 | |
add_theme_support( 'post-thumbnails' ); | |
} | |
add_image_size('small-thumbnail', 80, 80, true); | |
/* =============================================== |
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 ( has_post_thumbnail()) : ?> | |
<span class="post-thumb"> | |
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" ><?php the_post_thumbnail('thumbnail'); ?></a> | |
</span> | |
<?php endif; ?> |
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
/////////////////////////////////// | |
// Custom Post Type , Video | |
/////////////////////////////////// | |
// Custom Post - Project | |
function create_banner() { | |
// label for post type project. | |
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_archive() || is_category() || is_search() ) { | |
global $query_string; | |
parse_str( $query_string, $args ); | |
$args['post_type'] = array( 'ss-video', 'post' ); | |
query_posts( $args ); | |
} | |
?> |
OlderNewer