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
/* SHORTCODE WHICH INSERTS CURRENT YEAR | |
* usage: [year] | |
*/ | |
add_shortcode('year', 'year_shortcode'); | |
function year_shortcode() { | |
$year = date('Y'); | |
return $year; | |
} |
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
// REPLACE _* *_ WITH <STRONG> HTML IN WIDGET TITLES | |
// usage: _*This*_ word is bold | |
add_filter( 'widget_title', function($title) { | |
$title = str_replace('_*', '<strong>', $title); | |
$title = str_replace('*_', '</strong>', $title); | |
return $title; | |
} ); |
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
// FILTER WORDPRESS SEO BY YOAST outputs in the WordPress control panel | |
// remove WP-SEO columns from edit-list pages in admin | |
add_filter( 'wpseo_use_page_analysis', '__return_false' ); | |
// put WP-SEO panel at bottom of edit screens (low priority) | |
add_filter('wpseo_metabox_prio' , 'my_wpseo_metabox_prio' ); | |
function my_wpseo_metabox_prio() { | |
return 'low' ; | |
} |
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
/** | |
* Display specified content with a word limit | |
* Can be used for excerpts, full content, etc. | |
* In your theme file, use thus to display 40 words of the excerpt: | |
* $excerpt = get_the_excerpt(); | |
* echo string_limit_words( $excerpt, 40 ); | |
* | |
* @param string $string A variable containing the content you wish to display. | |
* @param num $word_limit The number of words to display. | |
* @return string Content limited to the number of words specified. |
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 | |
/* | |
Plugin Name: Posts 2 Posts List Widget | |
Plugin URI: http://friendlywebconsulting.com/ | |
Description: Creates a widget to display posts connected via the Posts 2 Posts plugin by Scribu, found here: http://wordpress.org/extend/plugins/posts-to-posts/ | |
Author: Michelle McGinnis | |
Author URI: http://friendlywebconsulting.com/ | |
Version: 1.0.0-alpha | |
*/ |
NewerOlder