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 to wp-config.php file ** | |
<?php | |
# Maximum 5 revisions # | |
define('WP_POST_REVISIONS', 5); | |
# Disable revisions # | |
define('WP_POST_REVISIONS', false); | |
?> |
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
//Create widget areas | |
<?php | |
// In functions.php | |
register_sidebar(array( | |
'name' => 'Sidebar', | |
'id' => 'sidebar', | |
'before_widget' => '<li>', | |
'after_widget' => '</li>', | |
'before_title' => '<h3>', |
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 | |
include_once(ABSPATH.WPINC.'/rss.php'); | |
$googleplus = fetch_feed("http://plusfeed.appspot.com/123456789..."); // Replace 123456789... by your own ID | |
echo '<a href="'; | |
echo $googleplus->items[0]['link']; echo '">'; | |
echo $googleplus->items[0]['summary']; | |
echo ''; | |
?> |
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 admin logo - 30px wide, 31px high transparent gif. Header background color: #464646 | |
add_action('admin_head', 'my_custom_logo'); | |
function my_custom_logo() { | |
echo ' | |
<style type="text/css"> | |
#header-logo { background-image: url('.get_bloginfo('template_directory').'/images/custom-logo.gif) !important; } | |
</style> | |
'; | |
} |
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_theme_support( 'post-thumbnails' ); | |
// This adds support for pages only: | |
add_theme_support( 'post-thumbnails', array( 'page' ) ); | |
// And this adds support for posts only: | |
add_theme_support( 'post-thumbnails', array( '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 | |
/* | |
Template Name: Name of your Template | |
*/ | |
?> |
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('widget_text', 'do_shortcode') ?> |
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 include_once(ABSPATH.WPINC.'/rss.php'); | |
wp_rss('http://wpforums.com/external.php?type=RSS2', 5); ?> |
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_filter('wp_nav_menu_items','add_search_box', 10, 2); | |
function add_search_box($items, $args) { | |
ob_start(); | |
get_search_form(); | |
$searchform = ob_get_contents(); | |
ob_end_clean(); | |
$items .= '<li>' . $searchform . '</li>'; | |
return $items; | |
} |
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 remove_footer_admin () { | |
echo 'My footer text. Thank you <a href="http://wordpress.org">Wordpress</a> for giving me this filter.'; | |
} | |
add_filter('admin_footer_text', 'remove_footer_admin'); | |
?> |