开发者 |
daveshine
deckerweb |
---|---|
更新时间 | 2019年2月21日 23:51 |
捐献地址: | 去捐款 |
PHP版本: | 3.2 及以上 |
WordPress版本: | 5.1 |
版权: | GPL-2.0+ |
版权网址: | 版权信息 |
New Flexibility plus Enhanced Webmaster Experience Changing the footer 'Copyright/Credits' & 'Return to Top' in Genesis is already easy with the use of Genesis Footer Shortcodes or some other plugins. However, it COULD still be much easier and more flexible with Widgets in WordPress! This plugin just achieves that, and at the same time keeping full Genesis Shortcodes support for the footer section! Yes, it's that cool! ;-) You can use up to two widget Areas! Place one - full-width then - or two (one third/two thirds then) and get back the flexibility you've wanted for this area! Manage your copyright/credits stuff the way YOU want it, without messing up your 'functions.php' file... Just place in a text widget with copyright stuff, another one with logos and/or affiliate links, an additional search widget, recent posts widget, some explanation via text widget... You got it. The possibilities are endless. Finally. A great helper tool for Genesis Child Themes!Please note: The plugin requires the Genesis Theme Framework, a paid premium product released by StudioPress/ Copyblogger Media LLC (via studiopress.com). Advantages
genesis-widgetized-footer.pot
) for translators is also always included :)genesis-widgetized-footer
folder to the /wp-content/plugins/
directory -- or just upload the ZIP package via 'Plugins > Add New > Upload' in your WP Admin/wp-content/languages/genesis-widgetized-footer/
(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, just use a language file like genesis-widgetized-footer-en_US.mo/.po
to achieve that (for creating one see the tools on "Other Notes").If you're satisfied with your configuration there's no need for this plugin. Never change a running system :). Otherwise you might find this plugin useful as it also supports all of the Genesis Footer Shortcodes! And you might have even more possibilities then.
Yes. If a child theme has repositioned its footer or done other things with that, my plugin cannot work. It relies on the default footer hook of Genesis which is used unchanged by almost all official child themes! For the slightly different footer functions in "Prose", "Pretty Young Thing" and "Modern Blogger" child themes is already full support included, though!
All of the seven available shortcodes are listed and explained here: Genesis Footer Shortcodes
This is possible and the plugin already comes with a handy helper function for that. Just use the following code in your child theme's functions.php file or in your functionality plugin:
/** Genesis Widgetized Footer: Reposition Disclaimer Widget to the Very Bottom */ add_action( 'genesis_before', '__gwfoot_footer_disclaimer_bottom' );
--> Explanation: This helper function just fires through the 'genesis_before' hook to catch the right priorities for loading stuff but places the whole widget area in the 'genesis_after' hook! Note: This function is fully compatible with the "Prose" child theme, as it does various checks.
Same as before using this plugin. The plugin does NOT touch any theme styles. Still it can be neccessary to tweak some styles, for example if you're using a search form in the footer you might change the button color or font size or whatever a bit. For extended styling of the new widget areas there a few IDs and classes included. These are:
#gwfoot-footer-one-area
.gwfoot-footer-one-full-width
.gwfoot-footer-one-one-third
.gwfoot-footer-one
#gwfoot-footer-two-area
.gwfoot-footer-two-full-width
.gwfoot-footer-two-two-thirds
.gwfoot-footer-two
#gwfoot-footer-disclaimer-area
.gwfoot-footer-disclaimer-content
.gwfoot-footer-disclaimer
gwfoot_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 the three widgets is active, so it's fully conditional!
Since plugin version 1.2.0+ both areas are hidden for all known landing page templates of official plus market/community child themes. Re-adding them is possible via your child theme's functions.php
file or a functionality plugin. Just add this code:
/** Genesis Widgetized Footer: Re-add Footer Widget Areas for Landing Pages */ define( 'GWFOOT_REMOVE_LANDING_FOOTER', FALSE );
Since plugin version 1.2.0+ removing is possible via your child theme's functions.php
file or a functionality plugin. Just add this code:
/** Genesis Widgetized Footer: Remove Disclaimer for Landing Pages */ define( 'GWFOOT_LANDING_DISCLAIMER', FALSE );
Yes, this is possible since plugin version 1.3.0! Just add this code to your child theme's functions.php
file or a functionality plugin:
/** Genesis Widgetized Footer: Remove Disclaimer Widget Area */ define( 'GWFOOT_NO_DISCLAIMER_WIDGET_AREA', TRUE );
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 Footer: Remove Widgets Shortcode Support */ define( 'GWFOOT_NO_WIDGETS_SHORTCODE', TRUE );
Some webmasters could need this for security reasons regarding their stuff members or for whatever other reasons... :).
(1) Parameters for [gwfoot-widget-area]
Shortcode:
area
-- ID of the Widget area (Sidebar) (default: none, empty)footer-one
OR footer-two
OR footer-disclaimer
[gwfoot-lastupdated]
Shortcode:
date_format
-- Date format (default: format you've set via "General Settings")wrapper
-- HTML wrapper tag (default: p
(paragraph))class
-- Additional custom CSS class for the wrapper (default: none, empty)text_before
-- Text string, displayed before the date (default: Latest update date:
)text_after
-- Text string, displayed after the date (default: none, empty)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 Footer: Remove Shortcode Features */ define( 'GWFOOT_SHORTCODE_FEATURES', TRUE );
I've just included some filters for that - if ever needed (i.e. for clients, branding purposes etc.), you can use these filters:
gwfoot_filter_footer_one_widget_title - default value: "Footer Area #1"
gwfoot_filter_footer_one_widget_description - default value: "This is the first widget area (%s) within the Genesis Footer." (where the %s
placeholder defaults to the gwfoot_filter_footer_two_widget_title
)
gwfoot_filter_footer_two_widget_title - default value: "Footer Area #2"
gwfoot_filter_footer_two_widget_description - default value: "This is the second widget area (%s) within the Genesis Footer." (where the %s
placeholder defaults to the gwfoot_filter_footer_two_widget_title
)
gwfoot_filter_footer_disclaimer_widget_title - default value: "Footer Disclaimer"
gwfoot_filter_footer_disclaimer_widget_description - default value: "This is the widget area of the search not found content section."
Example code for changing one of these filters:
`
add_filter( 'gwfoot_filter_footer_one_widget_title', 'gwfoot_custom_footer_one_widget_title' );
/**
**Final note:** I DON'T recommend to add customization code snippets to your child theme's
functions.php` file! Please use a functionality plugin or an MU-plugin instead!* This way you can also use this better for Multisite environments. In general you are not abusing the functions.php for plugin-specific stuff and you are then also more independent from child theme changes etc. If you don't know how to create such a plugin yourself just use one of my recommended 'Code Snippets' plugins. Read & bookmark these Sites:
functions.php
file: Resource One - Resource Two (both by Thomas Griffin Media)(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 footer credits logic for a lot of languages to your functions.php...
You can now also place the "Language Switcher Widget" at the bottom of your site :).
You can use the awesome "Widget Logic" plugin (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.:
`
/**
*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... }
[gwfoot-lastupdated]
for displaying the date when your site was last updated.[gwfoot-widget-area]
for displaying any of the plugin's 3 Widget areas (if active) into Shortcode aware content areas.gwfoot-styles.min.css
is the minified default version, plus, gwfoot-styles.css
is now the development version. If WP_DEBUG
or SCRIPT_DEBUG
constants are true
, the dev styles will be loaded. This makes development/ customizing & debugging a lot easier! :)#gwfoot-footer-disclaimer-area
and/or the new class within .gwfoot-footer-disclaimer-content
.)gwfoot-styles.dev.css
and is still packaged).