Passing Quotation Marks via wp_link_pages
According to the WordPress Codex 1, it is possible to pass quotation marks via the parameters of the function, wp_link_pages(). This would enable users to assign a particular css class or id to the function output, thereby providing greater design and behavioral control over that particular object.
But alas, as reported several times in the WordPress Codex 2, wp_link_pages() is unable to pass quotes without causing errors.
To fix this, we open template-functions-post.php and find wp_link_pages(), which is located around line #121 (for WP 2.0.2).
The fix is easy, simply edit the <p> in the following lines:
$r['before'] = '<p>' . __('Pages:');
$r['after'] = '</p>';
For example, if you wanted to wrap the function output with a <div class="foo"> and subsequent </div>:
$r['before'] = '<div class="foo">' . __('Pages:');
$r['after'] = '</div>';
Upload and done. Do not forget to eliminate the before= and after= parameters when calling the function from the loop 3.
References
Related articles
- WordPress RDF Source Makeover
- Reversing WordPress Page Navigation Order
- WordPress Notes Plus
- Perishable Press Triple Loop for WordPress
- Easily Adaptable WordPress Loop Templates
- Add RSS Feed Link Icons to WordPress Category Listings
- How to Generate Perfect WordPress Title Tags without a Plugin
About this article
This is article #150, posted by Jeff Starr on Monday, June 12, 2006 @ 03:41pm. Categorized as Function, WordPress, and tagged with navigation, php, post, tweaks, upgrade, WordPress. Updated on November 04, 2007. Visited 12962 times. 3 Responses »
Bookmark • Subscribe • Explore
« Reversing WordPress Page Navigation Order • Up • Meatspace via Cyberspace »
1 • June 12, 2006 at 8:34 pm — August Klotz says:
This works great but isn't always necessary. Often, some creative CSS works just as well..