Linux 软件免费装
Banner图

Genesis Widgetized Not Found & 404 - Easy Setup for 404 Page and Search Not Found

开发者 daveshine
deckerweb
wpautobahn
更新时间 2019年11月13日 07:44
捐献地址: 去捐款
PHP版本: 5.6 及以上
WordPress版本: 5.3
版权: GPL-2.0-or-later
版权网址: 版权信息

标签

widget page 404 search widgets error not found genesis genesiswp deckerweb genesis framework searchform

下载

1.0.1 1.1 1.0 1.2 1.3 1.4.0 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4

详情介绍:

New Flexibility plus Enhanced User Experience We all know that sometimes 404 Errors happen on our sites. And sometimes users search but get no results. I believe it's better to serve users some highly customized and maintained pages/content areas for these cases. What better to do that with Widgets in WordPress? -- In my opinion Genesis Framework could improve here so that's why I just made this little plugin to FINALLY have these two cases maintainable EASILY via your widgets admin. Just place in a search widget, your last blog posts, an image widget, some explanation via text widget, some galleries... You got it. The possibilities are endless. Finally. https://www.youtube.com/watch?v=0RJldBSH_fA Just a great helper tool for Genesis Child Themes! Please note: The plugin requires the Genesis Framework, a paid premium product released by StudioPress/ WPEngine, Inc. (via studiopress.com) What the Plugin Does - Advantages & Benefits General Features Translations Liked Genesis Widgetized Not Found & 404?

安装:

Minimum Requirements We Recommend Your Host Supports at least: Installation
  1. Install using the WordPress built-in Plugin installer (via Plugins > Add New - search for genesis widgetized not found), or extract the ZIP file and drop the contents in the wp-content/plugins/ directory of your WordPress installation.
  2. Activate the plugin through the 'Plugins' menu in WordPress.
  3. Go to Genesis > Not Found & 404 Page to adjust any widgets/ options for this plugin
  4. Alternatively go directly to the Widgets Admin or the Customizer to setup and preview the widget areas - configure your widgets for the "404 Error Page" and the "Search Not Found" page
  5. Hope the new widgets will never be needed, but in case, you're prepared now! :-)

屏幕截图:

  • Two additional Widget areas - here with some example widgets placed in
  • Live site: displaying 404 Page - widgetized now! (Demo: Genesis Sample 2.6.0)
  • Live site: displaying here the "Search not found" page (Demo: Genesis Sample 2.6.0)
  • Widgets in Customizer with Live Preview: setup the 404 Error Page Widget area (Demo: Genesis Sample 2.6.0)
  • The plugin's own search widget called "Genesis - Search Form" with way more options than the WordPress core search widget!
  • The lugin's optional Shortcodes in action for a page
  • Live site: Shortcode from test page in action (Demo: Genesis Sample 2.6.0)
  • Submenu on Genesis Settings - quick access to setup
  • The plugin's help tab on the Widgets admin page with additional info
  • Plugins page entry with Quick Jump Links for setup, preview/ testing

升级注意事项:

1.6.4 Now with WordPress 5.2 Site Health integration. Plus few internal improvements. - Update highly recommended! 1.6.3 Maintenance release. Important fix for Widgets. Bundled library update. - Update highly recommended! 1.6.2 Maintenance release. Bundled library update. Small tweaks. Update recommended. 1.6.1 Maintenance release: Various tweaks and improvements, plus updated bundled library. Update recommended. 1.6.0 Major release: Back in life :) - improved user guiding in admin. Lots of improvements, tweaks and fixes. 1.5.0 Major additions & improvements: Own search widget; Shortcodes. Some code & documentation optimizations and improvements. Also updated .pot file for translators plus German & Spanish translations. 1.4.0 Maintenance release: Improvements for the Widgets API. Minor code & documentation improvements. Also updated .pot file for translators plus German translations. 1.3.0 Maintenance release: Added help tab for Genesis settings. Minor code & documentation improvements. Also updated .pot file for translators plus German translations. 1.2.0 Several changes & improvements: Performance/Code improvements. Added little help tab, corrected typos and extended readme.txt documentation. Also updated .pot file for translators plus German translations. 1.1.0 Several changes & improvements: Added two layout helper functions. Further, improved conditional checks, code and documentation. Also updated readme.txt file as well as .pot plus German translations. 1.0.1 Several minor changes, mostly fixing two ugly bugs. Also changed readme files and updated translations. 1.0.0 Just released into the wild.

常见问题:

What HTTP Status Code gets delivered?

For the 404 error ("Page not found") the proper 404 HTTP status code gets delivered. This is completely done via Genesis itself, NOT by this plugin. This plugin "only" tweaks the content that is rendered on the 404 page in the browser. Everything else is done by Genesis. This is also how it should be. You can (bulk) check the status yourself for any URL on online services like these:

How can I change the layout of the '404 Error Page' (i.e. go full-width)?

You can use my "Genesis Layout Extras" plugin for that, which has an option for the 404 case built in. Or you can also use my built in helper function and add this little line to your functions.php of your child theme (backup file before!) or to the "Custom Function" section of Prose Child Theme 1.5+: /** Genesis Widgetized NotFound: 404 Error Page - Full-Width Layout */ add_action( 'genesis_meta', '__gwnf_layout_404_full_width' );

How can I change the layout of the 'Search not found' Page (i.e. go full-width)?

You can use my "Genesis Layout Extras" plugin for that, which has an option for the search case built in. -- Or you can also use my built in helper function and add this little line to your functions.php of your child theme (backup file before!) or to the "Custom Functions" section of Prose Child Theme 1.5+: /** Genesis Widgetized NotFound: Search not found Page - Full-Width Layout */ add_action( 'genesis_meta', '__gwnf_layout_searchnotfound_full_width' ); Note: The above code is restricted to the case when NO search results are found! It doesn't effect your search results display IF THERE ARE any results!

How can I style the content/widget areas?

It's all done via your child theme. Maybe you need to add an "!important" to some CSS rules here and there... For more even better styling I included some IDs and classes:

  • "404 Error Page" section:
  • the whole content area, before and after all widgets is wrapped in a div with the ID: #gwnf-404-area
  • each widget in this area has its own ID depending on the widget (regular WordPress behavior!)
  • each widget gets an additional class: .gwnf-404 -- which allows to set some common styles for all widgets in this area
  • "Search not found" section:
  • the whole content area, before and after all widgets is wrapped in a div with the ID: #gwnf-notfound-area
  • each widget in this area has its own ID depending on the widget (regular WordPress behavior!)
  • each widget gets an additional class: .gwnf-notfound -- which allows to set some common styles for all widgets in this area
Note, WordPress itself additionally adds body classes in the 404 case and the search not found case. So you can also use these classes: .error404 and .search-no-results If that's still not enough, you can even enqueue your own style, an action hook is included for that: gwnf_load_styles -- This hook fires within the WordPress action hook wp_enqueue_scripts just after properly enqueueing the plugin's styles and only if at least one of both widgets is active, so it's fully conditional!

Could I disable the Shortcode support for widgets?

Of course, it's possible! Just add the following constant to your child theme's functions.php file or to a functionality plugin: /** Genesis Widgetized Not Found & 404: Remove Widgets Shortcode Support */ define( 'GWNF_NO_WIDGETS_SHORTCODE', TRUE ); Some webmasters could need this for security reasons regarding their stuff members or for whatever other reasons... :).

What are parameters of the plugin's own Shortcodes?

(1) Parameters for [gwnf-widget-area] Shortcode:

  • area -- ID of the Widget area (Sidebar) (default: none, empty)
  • The following values are accepted: 404 OR notfound OR bbpress-notfound
(2) Parameters for [gwnf-search] Shortcode:
  • search_text -- Search placeholder text (default: Search this website)
  • button_text -- HTML wrapper tag (default: Search)
  • form_label -- Additional label before the search form (default: none, empty)
  • wrapper -- HTML wrapper tag (default: Latest update date:)
  • class -- Additional custom CSS class for the wrapper (default: none, empty)
  • post_type -- Optional setup post type(s) for search (default: none, empty - i.e., WordPress default search behavior!)

Could I completely remove the plugin's Shortcode features?

Of course, that's possible! Just add the following constant to your child theme's functions.php file or to a functionality plugin: /** Genesis Widgetized Not Found & 404: Remove Shortcode Features */ define( 'GWNF_SHORTCODE_FEATURES', TRUE );

Can I remove the widgetized content area for bbPress forum search "not found"?

Of course, that's possible - very easily :). Just add the following line of code to your child theme's functions.php file or a functionality plugin: ` /**

  • Genesis Widgetized Not Found & 404:
  • Remove bbPress Widgetized Content Area on "not found" */ add_filter( 'gwnf_filter_bbpress_noresults_widgetized', '__return_false' ); `

How can I customize the widget titles/strings in the admin?

I've just included some filters for that - if ever needed (i.e. for clients, branding purposes etc.), you can use these filters: gwnf/filter/widget_areas/404/title - default value: "404 Error Page" gwnf/filter/widget_areas/404/description - default value: "This is the widget area of the 404 Not Found Error Page." gwnf/filter/widget_areas/notfound/title - default value: "Search Not Found" gwnf/filter/widget_areas/notfound/description - default value: "This is the widget area of the search not found content section." gwnf_filter_notfound_default - default value: "Sorry, no content matched your criteria. Try a different search?" Example code for changing one of these filters: ` add_filter( 'gwnf/filter/widget_areas/404/title', 'custom_404_widget_title' ); /**

All the custom & branding stuff code above can also be found as a Gist on GitHub: https://gist.github.com/deckerweb/2473125 (you can also add your questions/ feedback there :)

How can I use the advantages of this plugin for multlingual sites?

(1) In general: You may use it for "global" widgets. (2) Usage with the "WPML" plugin: Widgets can be translated with their "String Translation" component - this is much easier than adding complex information/instructions to the 404 error or search not found pages for a lot of languages... You can use the awesome "Widget Options" or "Widget Logic" plugins (or similar ones) and add additional paramaters, mostly conditional stuff like is_home() in conjunction with is_language( 'de' ) etc. This way widget usage on a per-language basis is possible. Or you place in the WPML language codes like ICL_LANGUAGE_CODE == 'de' for German language. Fore more info on that see their blog post: http://wpml.org/2011/03/howto-display-different-widgets-per-language/ With the following language detection code you are now able to make conditional statements, in the same way other WordPress conditional functions work, like is_single(), is_home() etc.: ` if ( ! function_exists( 'is_language' ) ) : /* * WPML: Conditional Switching Languages * * @author David Decker - DECKERWEB * @link https://twitter.com/deckerweb * * @global mixed $GLOBALS[ 'sitepress' ] / function is_language( $current_lang ) { if ( $current_lang == $GLOBALS[ 'sitepress' ]->get_current_language() ) { return TRUE; } } // end function endif; ` Note: Be careful with the function name 'is_language' - this only works if there's no other function in your install with that name! If it's already taken (very rare case though), then just add a prefix like my_custom_is_language(). --> You now can use conditionals like that: if ( is_language( 'de' ) ) { // do something for German language... } elseif ( is_language( 'es' ) ) { // do something for Spanish language... }

More info on Translations?

  • English - default, always included
  • German (de_DE): Deutsch - immer dabei! :-)
  • For custom and update-safe language files please upload them to /wp-content/languages/genesis-widgetized-notfound/ (just create this folder) - This enables you to use fully custom translations that won't be overridden on plugin updates. Also, complete custom English wording is possible with that as well, just use a language file like genesis-widgetized-notfound-en_US.mo/.po to achieve that (for creating one see the following tools).
Easy WordPress.org plugin translation platform with GlotPress platform: Translate "Genesis Widgetized Not Found & 404"... Note: All my plugins are internationalized/ translateable by default. This is very important for all users worldwide. So please contribute your language to the plugin to make it even more useful. For translating and validating I recommend the awesome "Poedit Editor", which works fine on Windows, macOS and Linux.

更新日志:

⚡ 1.6.4 - 2019-05-04 ⚡ 1.6.3 - 2018-11-22 ⚡ 1.6.2 - 2018-11-03 ⚡ 1.6.1 - 2018-10-01 🎉 1.6.0 - 2018-08-25 🎉 1.5.0 - 2013-05-29 🎉 1.4.0 - 2012-12-15 🎉 1.3.0 - 2012-08-20 🎉 1.2.0 - 2012-04-27 🎉 1.1.0 - 2012-04-23 ⚡ 1.0.1 - 2012-04-20 🎉 1.0.0 - 2012-04-20