Installation
- If you are upgrading, first deactive the previous version of BiblioFly.
- Download the latest version (see http://www.deborahmcdonnell.com/damselfly/wordpress-plugins/bibliofly)
- Upload bibliofly.php into your plugins directory (usually /wp-content/plugins)
- Navigate to the Plugins page in your administration panel and activate the plugin BiblioFly
That's it! The plugin should automatically create/update the table it needs and after that you can manage your bibliography through your wordpress administration panel, under the Manage tab.
Embeddable Functions
Embed Entry
[bfentry id=# small]
Inserted into a wordpress post or page, the above code will embed the specified bibliography entry into the page. The command 'small' is optional; if omitted, the full bibliography entry will be embedded.
Print Full Page
[biblioflypage]
This is the function that prints out your bibliography page. Simply insert the above code into your WordPress Page. The function will grab all bibliography entries marked as visible, sort them into categories (novel, short fiction, poem, non-fiction book, article) and print them out in full.
Each bibliography category is printed under an <h3 class="bibliofly"> element. For an example, see my biblio page.)
This function uses non-default classes, in case you want the full entry styled differently on the biblio page compared to when you call it through random/recent/specific functions:
- bfpage: wraps the entire entry
- bfpage_img: wraps the image (don't forget to style bfpage_img img as well)
- bfpage_entry: wraps the entry (title and excerpt) beside the image
- bfpage_excerpt: wraps the excerpt so you can give it some form of highlighting
Print One Category Per Page
[biblioflypage type=#]
If you wish to restrict the function to calling only one category, this is the code to use, where:
- 1 = novel
- 2 = short fiction
- 3 = poem
- 4 = non-fiction books
- 5 = articles
Template Functions
Print Specific:
<?php bf_specific($id, $full) ?>
Prints a specific biblio entry.
- $id (Required): the ID number of the biblio entry you wish to display;
- $full (Optional) = "full" or "small" - Determines whether the function displays the small version (title & link) or the full version. Defaults to small if no second argument is provided.
Example 1:
<ul><?php bf_specific(3); ?></ul>
This will output an unordered list containing BiblioID #3 as its list item
Example 2:
<ul><?php bf_specific(3,"full"); ?></ul>
This will output a full bibliography entry for BiblioID #3, using the default CSS classes
Print Random:
<?php bf_random($full) ?>
Prints a random biblio entry.
- $full (Optional) = "full" or "small" - Determines whether the function displays the small version (title & link) or the full version. Defaults to small if no second argument is provided.
Each entry is wrapped in a list item, so you will need to call this function inside a parent list.
Example 1:
<ul><?php bf_random(); ?></ul>
This will output an unordered list (with one item ;) , so probably not so much call to use an ordered list here)
Example 2:
<ul><?php bf_random("full"); ?></ul>
This will output a random full bibliography entry, using the default CSS classes
Print Recent:
<?php bf_recent($limit); ?>
- $limit (Optional) - The maximum number of entries you wish to list. Defaults to all entries if omitted
This is the function I use in my sidebar: it calls the most recent bibliography entries, and displays them in descending order by id. It wraps each entry in <li class="bf_small"></li>, so you will need to call the function inside an ordered or unordered list.
Example:
<ul><?php bf_recent(3); ?></ul>
This will call the 3 most recently entered bibliography entries (eg if you have 10 entries, it will call 10, 9 & 8 (providing all three of those are marked as visible)).
Default CSS Classes
- bf_small: Called to wrap the 'short' entries. Wraps in <li></li> for template functions, or in <p></p> for the embeddable function
- bf_enclose: Called to print a full entry; wraps the entire entry
- bf_image: Called to print a full entry; wraps the image (don't forget to style bf_image img as well)
- bf_entry: Called to print a full entry; wraps the entry (title and excerpt) beside the image
- bf_excerpt: Called to print a full entry; wraps the excerpt so you can give it some form of highlighting
For the Bibliography Page
- .bibliofly: The headers on the bibliography page (<h3> for the category heading, and <h4> for the forthcoming heading) are called as "class = bibliofly" so you can style them to your heart's content without breaking the headings on the rest of your site
- bfpage: Called to print a full entry; wraps the entire entry
- bfpage_img: Called to print a full entry; wraps the image (don't forget to style bf_image img as well)
- bfpage_entry: Called to print a full entry; wraps the entry (title and excerpt) beside the image
- bfpage_excerpt: Called to print a full entry; wraps the excerpt so you can give it some form of highlighting
Disclaimer
I am far from being an expert in PHP. You can rest assured that all care was taken with this code, because I don't want to break my site (and because I based it on other peoples' code, so it should be stable enough). But I can't guarantee it won't break yours. If you have any questions or queries or suggestions, I'll do my best to answer them.