Snippets
开发者 |
businessxpand
|
更新时间 |
2009年9月23日 00:02 |
PHP版本: |
2.6.5 及以上 |
WordPress版本: |
2.8-beta1 |
详情介绍:
Do you need a placeholder for a fixed text, like the name of the current band at number one, your affiliate tracking codes, or just the name of your favourite fruit fly?
Snippets allows you to create fixed areas within your theme for this text to be displayed, and can easily be updated through your WordPress admin in the appearance menu. The snippet content can also be used in your posts and pages with a simple tag.
For theme developers we have included a functions.php file that allows you to create hardcoded snippet areas in your themes that your users can update with their own information.
This is the first release, so if you find any bugs then please tell us, if we are not told then they will not be fixed.
安装:
- Upload the
snippets
directory to your /wp-content/plugins/
directory.
- Activate the plugin through the
Plugins
menu in WordPress.
- Navigate to new
Snippets Setup
menu item under the Settings
menu.
- Add some new fields.
- Navigate to the
Snippets
menu under the Appearance
menu.
- Add some values to your fields.
- Add the following function call to your theme: <?php snippets_value( 'field name' ); ?> where
field name
is the exact name of the field you want to reference.
- Alternatively you can reference the snippet in your content with the follow: [snippets:field name] where
field name
is the exact name of the field you want to reference.
- The functions.php file can be copied to your own theme development to allow you to distribute snippet enabled areas within your themes, please read the comments in the source code of this file for more information on how to use it.