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 | |
$thumb_id = get_post_thumbnail_id(); | |
if ($thumb_id ) { | |
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail-size', true); | |
$thumb_url = $thumb_url_array[0]; | |
} | |
?> |
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 e = $(".mts-testimonial"), | |
t = $(".testimonials-authors li"), | |
f = $(".mts-testimonial:first"), | |
l = $(".testimonials-authors li:first"); | |
f.css({ | |
opacity: 1 | |
}); | |
l.addClass("active-testimonial"); | |
t.hover(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
<?php | |
add_filter( 'manage_posts_columns', 'ws_cutom_columns_head', 20 ); | |
add_action( 'manage_posts_custom_column', 'ws_cutom_columns_content', 10, 2 ); | |
function ws_cutom_columns_head( $columns ) { | |
$columns['ws_post_id'] = 'ID'; | |
return $columns; | |
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 | |
function insert_between_posts( $post ) { | |
global $wp_query; | |
// Check if we're in the right template | |
if ( ! is_home() ) | |
return; | |
// Check if we're in the main loop | |
if ( $wp_query->post != $post ) |
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 | |
/** | |
* Remove URL field from comment form in wordpress | |
* by Leo | |
* URL: http://wpsites.org/?p=10448 | |
*/ | |
add_filter('comment_form_default_fields', 'website_remove_url'); | |
function website_remove_url( $fields ) { | |
if ( isset($fields['url']) ) { | |
unset( $fields['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
<?php | |
add_filter( 'show_admin_bar', '__return_false' ); | |
remove_action( 'wp_footer', 'wp_admin_bar_render', 1000 ); | |
?> |
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 | |
/** | |
* Add a Character Counter to Excerpt box | |
* URL: http://wpsites.org/?p=10503 | |
*/ | |
function excerpt_count_js(){ | |
echo '<script>jQuery(document).ready(function(){ | |
jQuery("#postexcerpt .handlediv").after("<div style=\"position:absolute;top:5px;right:80px;color:#666;\"><small>Excerpt length: </small><input type=\"text\" value=\"0\" maxlength=\"3\" size=\"3\" id=\"excerpt_counter\" readonly=\"\" style=\"background:#fff;\"> <small>character(s). (128 Characters MAX)</small></div>"); | |
jQuery("#excerpt_counter").val(jQuery("#excerpt").val().length); |
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 | |
$gallery = get_post_gallery( $post, false ); | |
$ids = explode( ",", $gallery['ids'] ); | |
foreach( $ids as $id ) { | |
$link = wp_get_attachment_url( $id ); | |
$image = wp_get_attachment_image( $id, "thumbnail"); | |
echo( "<div class='item'><a href='$link'>" . $image . "</a></div>" ); | |
} | |
?> |
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( function_exists( 'pt_time_to_read' ) ) { echo pt_time_to_read( 'Time to read: ', ' Minutes' ); } ?> |