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
/* Add Below code where you are adding Metabox */ | |
global $post; | |
$template_file = get_post_meta( $post->ID, '_wp_page_template', TRUE ); | |
if ( $template_file == 'template-full-width.php' ) { | |
add_meta_box ( 'post_custom_field_id', __( 'Custom Field', 'rtPanel' ), 'rtp_posts_inner_custom_box', 'page', 'normal', 'high' ); | |
} |
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
/* Parent Style */ | |
.search-select-parent { | |
float: left; | |
margin: 5px 0 0 8px; | |
position: relative; | |
} | |
/* Select Style */ | |
.search-select-parent select { | |
display: block; |
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
/* Function Declaration for Equal Height */ | |
function rtp_equalHeight( group ) { | |
var tallest = 0; | |
group.each( function() { | |
var thisHeight = jQuery( this ).height(); | |
if ( thisHeight > tallest ) { | |
tallest = thisHeight; | |
} | |
} ); | |
group.height( tallest ); |
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
/** | |
* Add Photographer Name and URL fields to media uploader | |
* | |
* @param $form_fields array, fields to include in attachment form | |
* @param $post object, attachment record in database | |
* | |
* @return $form_fields, modified form fields | |
*/ | |
function rtp_attachment_field_credit( $form_fields, $post ) { | |
$form_fields['rtp-photographer-name'] = array( |
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
function create_page_taxonomy() { | |
register_taxonomy( 'category', array( 'page', 'post' ), array( | |
'hierarchical' => true, | |
'label' => __( 'Categories' ), | |
'singular_label' => __( 'Category' ), | |
'show_ui' => true, | |
'query_var' => true, | |
'rewrite' => 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
/** | |
* Remove HTML Filtering | |
*/ | |
remove_filter( 'pre_term_description', 'wp_filter_kses' ); | |
remove_filter( 'term_description', 'wp_kses_data' ); | |
/** | |
* Add WP_Editor to Category Description | |
* | |
* @param type $tag |
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
jQuery( document ).ready( function() { | |
/** | |
* Show Short Content | |
* Add Read More link after short text, | |
* Show full content after click on Read More | |
* | |
* Usage: | |
* jQuery( '.my-selector' ).rtpCharLength(); | |
*/ | |
( function( $ ) { |
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
jQuery( document ).ready( function() { | |
var isMobile = { | |
Android: function() { | |
return navigator.userAgent.match( /Android/i ); | |
}, | |
BlackBerry: function() { | |
return navigator.userAgent.match( /BlackBerry/i ); | |
}, | |
iOS: function() { | |
return navigator.userAgent.match( /iPhone|iPad|iPod/i ); |
OlderNewer