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 | |
function fresh_custom_admin_bar_init() { | |
if ( is_admin() || !is_admin_bar_showing() ) | |
return; | |
add_action('admin_bar_menu', 'fresh_custom_admin_bar_links', 500); | |
} | |
add_action('admin_bar_init', 'fresh_custom_admin_bar_init'); | |
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 | |
function get_current_post_type() { | |
global $post, $typenow, $current_screen; | |
if ($post && $post->post_type) | |
return $post->post_type; | |
elseif ($typenow) | |
return $typenow; | |
elseif ($current_screen && $current_screen->post_type) | |
return $current_screen->post_type; | |
elseif (isset($_REQUEST['post_type'])) |
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 | |
add_filter( 'genesis_markup_header-widget-area_output', 'prefix_opening_header_div', 10, 2 ); | |
/** | |
* Replace the opening header-right <aside> tag with a <div> tag to allow the | |
* primary nav to be used in the header without being wrapped in an aside tag. | |
* | |
* @param $tag string The current tag for the .header-right widget area. | |
* @param $args array The current args for genesis_attr() | |
* @return $tag string The modified tag for the .header-right widget area. |
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
RewriteRule ^dashboard/(.*) wp-admin/$1?%{QUERY_STRING} [L] | |
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] |
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 | |
// Only run the code if we are in the admin | |
if ( is_admin() ) : | |
class WordPressdeleteMissingImages { | |
// Action/Filter Hooks | |
function __construct() { | |
add_action( 'admin_menu', array( &$this, 'add_page' ) ); |
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 | |
/** | |
* Gets the URL of current page or requested page | |
*/ | |
function bw_get_url($url) { | |
if ($_SERVER['REQUEST_URI'] == '') { | |
$url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REDIRECT_URL']; | |
} else { | |
$url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; | |
} |
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
//uses single template but not as good for theme compatability | |
<?php | |
function custom_template_snippet_post_type_plugin( $single ) { | |
global $wp_query, $post; | |
if ($post->post_type == "sdr_snippet"){ | |
// if in subfolder | |
$template = plugin_dir_path( __FILE__ ) . 'templates/single-snippet.php'; | |
// if in plugin root directory folder | |
//$template = plugin_dir_path( __FILE__ ) . '/single-snippet.php'; |
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 | |
// do NOT include the opening line! Just add what's below to the end of your functions.php file | |
add_action( 'edit_form_after_title', 'rgc_posts_page_edit_form' ); | |
function rgc_posts_page_edit_form( $post ) { | |
$posts_page = (int) get_option( 'page_for_posts' ); | |
if ( $posts_page === $post->ID ) { | |
add_post_type_support( 'page', 'editor' ); | |
} |
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
#formbox { | |
width: 130px; /* fallback for browsers without support for calc() */ | |
width: calc(100% / 6); | |
border: 1px solid black; | |
padding: 4px; | |
} | |
input { | |
padding: 2px; | |
display: block; | |
width: 98%; /* fallback for browsers without support for calc() */ |