开发者 |
Gwolle
mpol |
---|---|
更新时间 | 2024年11月15日 19:12 |
PHP版本: | 7.0 及以上 |
WordPress版本: | 6.7 |
版权: | GPLv2 or later |
show_gwolle_gb();
to show the guestbook in your templates.
It couldn't be easier.
Updating from an old version
With version 1.0 there have been some changes:
You could start by writing the first entry yourself, and invite people to leave a message.
Starting with version 1.0, the following entries are listed on the Frontend:
Translations can be added very easily through GlotPress. You can start translating strings there for your locale. They need to be validated though, so if there's no validator yet, and you want to apply for being validator (PTE), please post it on the support forum. I will make a request on make/polyglots to have you added as validator for this plugin/locale.
By default this plugin uses a Honeypot feature and a Timeout feature. If spambots try to post guestbook entries this should work sufficiently. If you still have problems there are more options:
WP-SpamShield is a general plugin for anti-spam that supports the general WordPress forms and many plugins. Activating WP-SpamShield will disable the anti-spam features in Gwolle Guestbook and all anti-spam will be handled by WP-SpamShield. If you don’t want to use WP-SpamShield’s protection for Gwolle Guestbook, then all you need to do is disable Anti-Spam for Miscellaneous Forms in WP-SpamShield settings.
You can add a parameter to the shortcode, like: [gwolle_gb book_id="2"] This will make that page show all the entries in Book ID 2. In case you read this on wordpress.org, the quotes are supposed to be standard double quotes, no backticks. If you use the template function, you can use it like this: show_gwolle_gb( array('book_id'=>2) );
There is no need to use id's that are incrementing. If you have a lot of guestbooks on lots of pages, you can just use the id of the post as the id of the guestbook. That way you won't have double id's. You can set the book_id automatically to the post_id with this shortcode: [gwolle_gb book_id="post_id"] In case you read this on wordpress.org, the quotes are supposed to be standard double quotes, no backticks.
This is not really supported and might result in strange issues.
You can use a shortcode parameter for showing just one entry: [gwolle_gb_read entry_id="213"] In case you read this on wordpress.org, the quotes are supposed to be standard double quotes, no backticks.
This plugin doesn't apply any CSS to the label elements. It is possible that your label elements have a white color on a white background. You can check this with the Inspector in your browser. If that is the case, you have a theme or plugin that is applying that CSS to your label elements. Please contact them.
First check your spambox in your mailaccount. Second, on the settingspage you can change the From address for the email that is sent. Sometimes there are problems sending it from the default address, so this is a good thing to change to a real address. There are also several SMTP plugins, where you can configure a lot of settings for email. If it still doesn't work, request the maillog at your hosting provider, or ask if they can take a look.
There are different shortcodes that you can use. Instead of the '[gwolle_gb]' shortcode, you can use '[gwolle_gb_write]' for just the form, and '[gwolle_gb_read]' for the list of entries. There is also a widget that can display the latest entries in a widget area, that has many options. Alternatively you can use the shortcode '[gwolle_gb_widget]' to display the latest entries in widget layout. Parameters are:
The shortcodes '[gwolle_gb]' and '[gwolle_gb_write]' have a parameter for the button. You can use them as '[gwolle_gb button="false"]' or '[gwolle_gb_write button="true"]', to deviate from the default.
If a user with capability of 'gwolle_gb_moderate_comments' posts an entry, it will be marked as checked by default, because he can mark it as checked anyway.
There is validation of the length of words in the content and author name. If the words are too long and it looks abusive, it will be marked as unchecked. A moderator will still be needed to manually edit and check these entries.
You can refresh your rewrite rules, by going to Settings / Permalinks, and save your permalinks again. This will most likely add the rewrite rule for the RSS Feed.
When you have moderation disabled, Gwolle Guestbook will try to refresh the cache. If it doesn't on your setup, please let me know which caching plugin you use, and support for it might be added. You can also refresh or delete your cache manually. Most caching plugins offer support for that.
There are 2 settings that you need to pay attention to. If you saved the settings for the form tab, you should save an empty header and notice text. It will fill in the default there after saving, but that is okay. As long as you saved an empty option, or it is still not-saved, then it will show the translated text from your MO file. Also, you will want to use the book_id parameter of the shortcode for multiple guestbooks.
Using a theme with AJAX navigation can give issues. Only on the guestbook page is the JavaScript and CSS loaded. So you would need to load it on every page to have it available for the guestbook. You can add the following code to functions.php of your theme: I don't have any experience myself with AJAX themes. If it doesn't work, please contact the theme author.
You could use this CSS. Please adapt the colors ;) The CSS can be added in Appearance > Customizer > Custom CSS. html body div.gwolle-gb input[type="button"], html body div.gwolle-gb input[type="submit"] { color: #fff; / white / background-color: #f00; / red / border: 1px solid #0f0; / green / } html body div.gwolle-gb form.gwolle-gb-write div.input input[type="text"], html body div.gwolle-gb form.gwolle-gb-write div.input input[type="email"], html body div.gwolle-gb form.gwolle-gb-write div.input input[type="url"], html body div.gwolle-gb form.gwolle-gb-write div.input textarea, html body div.gwolle-gb form.gwolle-gb-write div.input select { border: 1px solid #0f0; / green / }
The frontend scripts will only be loaded on the Guestbook page, so they won't be added to autoptimize. You can add 'gwolle_gb_frontend' to both the comma-separated JS and CSS autoptimization exclusion list. That way it will still be loaded right. On the autoptimize settings page, you might have to click on "show advanced settings"-button top-right first. More info on troubleshooting in AO's FAQ.
For moderating comments you need the capability 'gwolle_gb_moderate_comments'. For managing options you need the capability 'manage_options'.
You can look at 'frontend/gwolle_gb-entry.php', and copy it to your theme folder. Then it will be loaded by the plugin. Make sure you keep track of changes in the default templatefile though. It is often better to use filters, that way you are more forward-compatible.
There are many hooks available in this plugin. Documentation is included in the zip file in /docs/actions and /docs/filters. Examples are included. If you have a need for an additional hook, please request this in the support forum.
First, this plugin is a guestbook. If you want to use it for a different usecase, you will need to do that in code. Take a look at the previous question about hooks. You are probably wanting to use these two hooks:
Also, the add-on has options for text changes.It should be possible by using a filter. Have a look at this example code. Make sure to use the correct anchor tag for your website.
Sure you can if you want to. In my personal opinion however it can be a good thing to keep comments and guestbook entries separated. So if you already have a blog with comments, the guestbook entries might get lost in there, and keeping a separate guestbook can be good. But if you don't use standard comments, you can just as easily use the comment section for a guestbook.