public
Last active

Genesis Widgetized Not Found & 404 plugin v1.0.0 or higher -- helper functions, plus filters for customizing and branding

  • Download Gist
gwnf-helper-functions.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
<?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' );
}
gwnf-helper-styles.css
CSS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/* 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 {
}

Note: The above codes work with plugin version 1.0.0 or higher!

Extended explanation can be found at the plugin's page "FAQ" section at the bottom:
http://wordpress.org/plugins/genesis-widgetized-notfound/faq/

Download "Genesis Widgetized Not Found & 404" plugin at wordpress.org:
http://wordpress.org/plugins/genesis-widgetized-notfound/

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

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 ;-)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.