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 meta tags for generator, feed links, and pagination | |
Useful for landing pages or static, stand-alone sites/pages. | |
*/ | |
remove_action( 'wp_head', 'wp_generator'); | |
remove_action( 'wp_head', 'feed_links', 2 ); | |
remove_action( 'wp_head', 'feed_links_extra', 3 ); | |
remove_action( 'wp_head', 'rsd_link'); // EditURI | |
remove_action( 'wp_head', 'wlwmanifest_link'); // Windows Live Writer |
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
// customized login page CSS | |
// from http://www.wpsyntax.com/wordpress/7-functions-white-label-wordpress | |
add_action('login_head', 'my_theme_custom_login'); | |
function my_theme_custom_login() { | |
echo '<style type="text/css"> | |
h1 a { background-image:url('.get_stylesheet_directory_uri().'/img/logo-login-274-63.png) !important; } | |
</style>'; | |
} | |
// link login page logo to the site's URL instead of wordpress.org |
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
// extra body classes based on the post meta | |
add_filter('body_class','theme_body_class'); | |
function theme_body_class($classes) { | |
$body_classes = get_post_meta(get_the_id(), 'body-class'); | |
if (false !== $body_classes && count($body_classes) > 0) | |
$classes = array_merge($classes, $body_classes); | |
return $classes; |
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
/* actions fired when listing/adding/editing posts or pages */ | |
/* admin_head-(hookname) */ | |
add_action( 'admin_head-post.php', 'admin_head_post_editing' ); | |
add_action( 'admin_head-post-new.php', 'admin_head_post_new' ); | |
add_action( 'admin_head-edit.php', 'admin_head_post_listing' ); | |
function admin_head_post_editing() { | |
echo 'you are editing a 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
add_filter( 'post_type_link', 'my_post_type_link', 10, 3); | |
function my_post_type_link($permalink, $post, $leavename) { | |
if ($post->post_type == 'my-post-type') { | |
$meta = get_post_meta($post->ID, '_my-post-meta', true); | |
if (isset($meta) && !empty($meta)) | |
$permalink = home_url( "my-friendly-url/" . $meta . "/" . $post->post_name . "/"); | |
} | |
return $permalink; |
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 | |
/* | |
Plugin Name: My Document Permalink | |
Description: Custom post type (my-document) for docs (PDFs, etc) | |
Version: 1.0 | |
Author: Pete Nelson | |
*/ | |
add_action('init', 'my_register_document_post_type'); |
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 | |
/* | |
Plugin Name: GGA Joomla Content Importer | |
Description: Imports articles from Joomla 1.5x into WordPress | |
Author: <a href="https://twitter.com/GunGeekATX" target="_blank">@GunGeekATX</a> | |
Version: 1.1 | |
*/ | |
class ggaJoomlaArticleImporter |
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 | |
/* | |
Author: Pete Nelson @GunGeekATX | |
Expands upon the Custom Meta Boxes library to provide a user-facing input form, | |
list & detail page of custom post types. This code sample doesn't include all the libraries | |
such as jQuery tablesorter or validate but can be found elsewhere easily enough. | |
*/ |
OlderNewer