开发者 |
nicethemes
juanfra andrezrv ricardoaiello |
---|---|
更新时间 | 2020年6月30日 01:32 |
PHP版本: | 3.6 及以上 |
WordPress版本: | 4.7 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
nice_likes()
PHP function to show likes anywhere you want.
Developer friendly
Nice Likes is developed following the WordPress Coding Standards. It relies on the native templating architecture of WordPress, and includes a huge set of hooks and pluggable functions and classes, so you can customize it in any way you need.
nice-likes.zip
from your computer.nice-likes.zip
.nice-likes
directory to your computer.nice-likes
directory to the /wp-content/plugins/
directory.Once you installed and activated the plugin, you can go to Settings > Likes and tweak the options there.
The simplest way to include likes in your own templates is using our nice_likes()
function. This is a very basic usage example:
```
```
However, we recommend you to use the nice_likes_custom
action, which allows to select via Likes Settings where likes will be displayed. In the settings page, you'll be presented with three options for the location of your likes: before your post content, after your post content, or in a custom location. If you chose the later, you're gonna need to add <?php do_action( 'nice_likes_custom' ); ?>
to the the part of your template where you want your likes to display, while still having the possibility to move them to the top or bottom of your content in case you need to.
You can load a custom stylesheet by using wp_enqueue_script() and adding your custom CSS to your own file. However, if you really want to get rid of the default CSS of Nice Likes, so you can avoid overriding our styles, you can check the "Avoid Plugin CSS" option in Settings > Likes.
plugins_loaded
.