Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Genesis Widgetized Not Found & 404 plugin v1.0.0 or higher -- helper functions, plus filters for customizing and branding
<?php
/** Do NOT include the opening php tag */
// since plugin version v1.1.0:
/** Genesis Widgetized NotFound: 404 Error Page - Full-Width Layout */
add_action( 'genesis_meta', '__gwnf_layout_404_full_width' );
/** Genesis Widgetized NotFound: Search not found Page - Full-Width Layout */
add_action( 'genesis_meta', '__gwnf_layout_searchnotfound_full_width' );
//
// since plugin version v1.0.0:
//
add_filter( 'gwnf_filter_404_widget_title', 'custom_404_widget_title' );
/**
* Genesis Widgetized NotFound: Custom 404 Widget Title
*/
function custom_404_widget_title() {
return __( 'Custom Error Page', 'your-child-theme-textdomain' );
}
add_filter( 'gwnf_filter_404_widget_description', 'custom_404_widget_description' );
/**
* Genesis Widgetized NotFound: Custom 404 Widget Description
*/
function custom_404_widget_description() {
return __( 'This is the widget area of Your custom Not Found Error Page.', 'your-child-theme-textdomain' );
}
add_filter( 'gwnf_filter_notfound_widget_title', 'custom_notfound_widget_title' );
/**
* Genesis Widgetized NotFound: Custom Search not found Widget Title
*/
function custom_notfound_widget_title() {
return __( 'Custom Search not found Page', 'your-child-theme-textdomain' );
}
add_filter( 'gwnf_filter_notfound_widget_description', 'custom_notfound_widget_description' );
/**
* Genesis Widgetized NotFound: Custom Search not found Widget Description
*/
function custom_notfound_widget_description() {
return __( 'This is the widget area of Your custom Search not found Page.', 'your-child-theme-textdomain' );
}
add_filter( 'gwnf_filter_notfound_default', 'custom_notfound_default' );
/**
* Genesis Widgetized NotFound: Custom Not found Default
*/
function custom_notfound_default() {
return __( 'Mmh, you didn\'t broke the Internet this time. Maybe, it\'s time for another search?', 'your-child-theme-textdomain' );
}
/* Genesis Widgetized NotFound: 404 Error Page section
------------------------------------------------------------ */
/* Wrapper */
#gwnf-404-area {
}
/* Each widget */
.gwnf-404 {
}
/* Genesis Widgetized NotFound: Search Not Found section
------------------------------------------------------------ */
/* Wrapper */
#gwnf-notfound-area {
}
/* Each widget */
.gwnf-notfound {
}
@Ramoonus
Copy link

Ramoonus commented Apr 27, 2012

why not declare 'your-child-theme-textdomain' as a variable?

@deckerweb
Copy link
Author

deckerweb commented Apr 27, 2012

Because of this: http://markjaquith.wordpress.com/2011/10/06/translating-wordpress-plugins-and-themes-dont-get-clever/ and also this: http://ottopress.com/2012/internationalization-youre-probably-doing-it-wrong/

And because it's the proper standard to use a string!

Soon it will be a requirement for wordpress.org themes and plugins so that their upcoming language packs will work.

Constants and variables have no advantage here, as in some cases they can also block translations loading. Also, 'search & replace' is your friend ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment