Yes, I have finally done it. I have added writing a wordpress plugin to my repertoire of skills. This is the first time I have ever released code for other people to use , so please be gentle.
This plugin has been written to overcome something that is a personal bugbear about WordPress for me and that is its multiple page posts. The built-in function that provides pagination for posts is very limited and just does not give you the flexibility to find the perfect navigation system for your blog.
WordPress as standard has the ability to paginate your posts, i.e. split very long posts over separate pages. You do this by using the <!–nextpage–> tag to create page breaks, the real shortfall of the built-in function is there is no way of adding titles or headings to these pages – something like index or content list, so readers can jump straight to specific areas – this is commonly seen on hardware review sites.
I wrote this plugin to try and improve this area and open up even more possibilities with WordPress.
My plugin provides 3 functions.
- Add titles or headings to each page (using <!–pagetitle:–>)
- Display number of pages on index pages (TA_display_pages)
- Quick jump and title navigation options (TA_content_jump)
Very easy to use and very simple to integrate in to any theme.
Installation
- Download file (here)
- Unzip and place directory in to your “plugins” folder (/wp-content/plugins/)
- Activate plug-in through the admin panel
Change Log
Version 2.6 (5th Sept 2008)
Added auto insertion for Pages as well as Posts
Fixed issues with saving settings
Fixed html and code entry in to text boxes
Version 2.5 (10th July 2008)
SVN broke upload – uploading again
Version 2.4
Changed CSS style naming for the all page links
Version 2.3 (internal release)
Added option to have custom page seperators (including javascript for adverts) on single (ALL) page display
Added function call to use options page settings from inside the theme files
Fixed badly coded string matching (Thanks to Andrei for the fix)
Fixed spelling error in button registration process (Thanks to Jonathan for spotting this)
Fixed maintain trailing slash consistency across site
Version 2.2 (internal release)
Added ALL link Display Text Option
Added new CSS class for ALL link styling (contentjumpall , contentlistall)
Fixed bug where pagetitle followed by nextpage caused errors
Fixed tinymce js cache issues (hopefully..)
Fixed navigation for preview draft posts
Version 2.1 (30th May 2008)
Major Update
New Display ALL pages link, view multipage posts on single page
Added Auto Insert Options page, no more code necessary
Visual Editor Integration, buttons to add page breaks and page titles
Version 1.2 (20th March 2008)
Added a check for trailing slashs and permalink structure for paging
Cleaned up readme.txt for better formatting
Checked compatibility with WordPress 2.5
Version 1.1 – Add new quickjump method – list menu / content table
Version 1.0 – Initial version
Donations
Please consider donating if you have found this plugin useful, it helps pay for my hosting!!
How to use
Function TA_display_pages
This function allows you to simply display page information for your posts on the post listing pages (such as index, categories and tag pages). It can also be used to display the page number of the current page.
Insert the following code into your theme files in the location you want the page information to appear:
<?php if(function_exists(‘TA_display_pages’)) { TA_display_pages(); } ?>
In my case I added the code in to my index.php , category.php and tag.php files. Next to the post title code. Here is the code as used in my index.php file:
<h2><a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></a><?php if(function_exists(‘TA_display_pages’)) { TA_display_pages(‘ <small>(‘,’ pages)</small>’,”,’total’); } ?></h2>
Options
TA_display_pages($firsttext, $lasttext, $midtext, $display_type)
-
$firsttext = ‘ Page ‘
-
$lasttext = ‘ ‘
-
$midtext = ‘ of ‘ (only used when display_type is all)
-
$display_type = ‘all’ (total , current, all)
Examples
Default settings Page 1 of 3TA_display_pages(‘(‘,’ pages)’,”,’total’) (3 pages)
TA_display_pages(‘(you are on page ‘,’ now)’,”,’current’) (you are on page 1 now)
Go on to the next page to read about the other functions.
Nice plugin. Only problem is, with any system where php gets are used for setting the language, your plugin will break: ?lang=frall/1 being the sort out output recieved, instead of /1?lang=fr.
I’ve modified it to work for my site: include the line $del = explode(“?”, get_permalink());
and replace all occurances of get_permalink() with $del[0], as well as affixing “?” .$del[1]. to all outputs.
(Not exact code, but you get the gist).
Hello, first of all, thanks for the plug-in.
The plug-in worked fine until I recently upgraded to WP3.1, the page links no longer appear after the WP upgrade, will there be an update soon? Thanks.
Dave (www.davidleetong.com)
Im using this on my site http://www.originbmx.com it’s great thanks!
I’m a WP newbie and am in process of migrating my Blogger Blog to WP. I want to break individual posts into multi-page posts. I’ve read that the original plug-in doesn’t work on WP 3.0.
Can anyone provide guidance about how to achieve multi-page post functionality for a WP 3.0 blog?
Thanks in advance!
I did a little bit more trial-and-error, and it started working again when I deactivated the Role Scoper plugin – which makes sense, since it was erroring on a role-related function, has_cap(). Must have been some bizarre conflict somewhere along the line. Not sure why it would have started working when MPT was deactivated but it looks like that was just a red herring. 🙂
Again, fantastic plugin!
Hi Kevin,
Never seen anything like that before. The error messages seem very un-related to my plugin.
You could have a corrupted database – my plugin does not make any changes to the database, so cannot see it messing things up.
Try looking through the db with phpmyadmin.
Hey Tarkan… this plugin is incredible and does exactly what I need it to do, but I’m having some issues using it with WP 2.9.2. Particularly, when I’m logged out and I try to access wp-admin, I get the following error on an otherwise-blank page:
—–
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘stdClass::has_cap’ was given in /www/wp-includes/capabilities.php on line 977
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘stdClass::has_cap’ was given in /www/wp-includes/capabilities.php on line 977
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘stdClass::has_cap’ was given in /www/wp-includes/capabilities.php on line 977
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘stdClass::has_cap’ was given in /www/wp-includes/capabilities.php on line 977
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘stdClass::has_cap’ was given in /www/wp-includes/capabilities.php on line 977
Warning: Cannot modify header information – headers already sent by (output started at /www/wp-includes/capabilities.php:977) in /www/wp-includes/pluggable.php on line 868
—–
If I try to access wp-login.php directly, everything works fine, but wp-admin has issues when I’m not already logged in. I was baffled for awhile, but as I deactivated the plugins one by one, wp-admin finally worked properly after I deactivated Multi-Page Toolkit.
I’ve been looking through the code for awhile now but can’t find anything that may cause it… so far I’ve hard-coded the settings and I’ve disabled the admin options page in effort to isolate the problem, but it still does the same thing. Any ideas? Has anyone else experienced this?
Hi,
Have you tried using the auto insert rather than manual insertion in to your template. I run it on my site and it is working ok, including manual insertion.
Hi,
this plugin with WordPress 2.9.2 don’t work for me.
I put “TA_content_jump(1);” in my template but I don’t see any results in rendered page.
How I can solve my problem? Can you help me?!
Love it. I have been looking high and low for something like this. I’ve only added page numbers to one post so far. But I have a question. How do I deactivate the WP page numbers. http://mssparky.com/2010/04/daughter-of-kbr-employee-killed-by-friendly-fire-in-iraq-can-sue/
Your plug-in is top right and bottom center above the social networking. The WP page numbers are lower left. How do I get those to go away?
Also, is there an option to “fancy up” the look of the page numbers…like buttons or something…not complaining. 🙂
I am not a code person and am still learning about blogging. Any other suggestions about how to best utilize this plug-in are welcome.
Thank you
Ms Sparky
Pingback: quickjump menu
Sorry, I resolved the point 2 myself going under Admin -> Settings -> MultiPage Toolkit and changing the options.
So I went manual.
I still have the problem #1, I need to get the page titles in the loop, as you see there it’s still not possible to me:
http://www.alvisenicoletti.com/works/
Hi!
I use perfectly your plugin, but I have two problems:
1. in the loop of a category, I can’t display the sub-pages names.
In that case, only the original wp_link_pages works giving me numbers and not the titles.
I want to take out the page titles.
Can you help me to understand how to do it?
2. inside single articles, your plugin puts out automagically the menù after the content.
For styling reasons, I would like to put it out before the content, after the title.
Can you help me to do this?
Actually this is an example of the page:
http://www.alvisenicoletti.com/works/
Thanks for your plugin. I want ask you if is possible filter pagetitle for multilingual.
nevermind…. duh. gotta remove linkpages from the template.
How do I remove wordpress’s default pagination? Using your plugin lets me have the cool custom page listings, but the default wordpress “Page: 1 2” is still at the bottom. How do I get rid of that?
First off this is great plug in, I have seen it in action….unfortunately I can’t get it to work properly.
* I can get it to show the dropdown menu numbered, titles no work at all, make pages split with no title. Also when I try to get it to center it will only stay left side. Even thou I can get the numbered dropdown to work on left side when you go to second page the 2nd and 3rd columns of page are dropped down below the first page. It’s a mess. Im doing the auto not manual. PS I can’t code! Should I look another plugin or this one able to work. I really like this one very much so I hope you can help. I dont mind donating some cash to this project either and I really like what it does.
HELP!
No Worries, I’ve just realized my stupid free hosting server takes a very long time to update, no wonder why it wasn’t making any changes. It’s ok now!
Is there any documentation to explain more about the CSS styling? Like which ID refers to which part of the buttons? I’m new to wordpress, I don’t seem to be able to change the style of the buttons following the guide provided.
Here’s the problem that I’m having:
For some reason, when I click on the View All link, any shortcodes that I have on pages after the first don’t execute (I’m using WP-Table Reloaded). When I click on the page name, however, they execute just fine.