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 dimox_breadcrumbs() { | |
/* === OPTIONS === */ | |
$text['home'] = 'Home'; // text for the 'Home' link | |
$text['category'] = 'Archive by Category "%s"'; // text for a category page | |
$text['search'] = 'Search Results for "%s" Query'; // text for a search results page | |
$text['tag'] = 'Posts Tagged "%s"'; // text for a tag page | |
$text['author'] = 'Articles Posted by %s'; // text for an author page |
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 | |
/** | |
* List all image sizes in a WordPress post | |
* by Leo | |
* URL: http://wpsites.org/?p=10617 | |
*/ | |
$images = array(); | |
$image_sizes = get_intermediate_image_sizes(); | |
array_unshift( $image_sizes, 'full' ); | |
$img_id = get_post_thumbnail_id( get_the_ID() ); |
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_action( 'wp_enqueue_scripts', 'pt_like_it_scripts' ); | |
function pt_like_it_scripts() { | |
if( is_single() ) { | |
wp_enqueue_style( 'like-it', trailingslashit( plugin_dir_url( __FILE__ ) ).'css/like-it.css' ); | |
if (!wp_script_is( 'jquery', 'enqueued' )) { | |
wp_enqueue_script( 'jquery' );// Comment this line if you theme has already loaded jQuery | |
} | |
wp_enqueue_script( 'like-it', trailingslashit( plugin_dir_url( __FILE__ ) ).'js/like-it.js', array('jquery'), '1.0', 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( function_exists( 'pt_time_to_read' ) ) { echo pt_time_to_read( 'Time to read: ', ' Minutes' ); } ?> |
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 | |
/** | |
* 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 | |
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 | |
/** | |
* 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'] ); |
OlderNewer