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.
Hi, thanks for the feedback – I am about to release another version – I will look in to the issues you have mentioned before release.
Hi Tarkan, and congratulations on this plugin.
There are two issues; first, it seems not to work together with global translator. E.g. the second (translated) page is again the first.
The other issue is that navigation adds a slash at the end, even if the permalink structure is the default (?p=1 etc).
Is there anything to be done for these?
Kind regards
wow! excellent job and hope it will work for me..
thanks
ok .. page numbers displays … but how do i get the dropdown box in a post or page ?? can anyone help…
ALL link does not display. Pages works. Display ALL Link is selected, but does not appear. Tested on IE 7 and FF 2.
Hi Tarkan… thx for ur reply mate… its great that the instruction you gave fits and displays the button !!
well… but are they working ?.. an inserted page title is not showing in the web page… am i wrong somewhere ??
I was going to do that for the next release. I made so many changes to the plugin for the 2.1 release, I thought things like that can wait.
My another request is that, could you please make an option for changing “View All” and “ALL” texts? I would like to write them in my own language, but I could not see an option. I do not want to change them in the source code each time the plugin is updated.
Hi Dun, Thanks for the feedback – I have just tested it out and yes you are right the multipage aspect does not when previewing a post which has not been published.
I will have it fixed in the next version.
Flixnet,
Some else has mentioned this to me, it is taking anything from a few hours to a day for the buttons to appear.
The issue is because the visual editor uses a cache file for the javascript. I am working on fixing it in the next release.
The best thing to do is follow the instruction above and delete the cache file in wp-content / uploads / js_cache.
Then go to the visual editor and do a full reload (IE ctrl-f5). Hopefully the buttons should then appear.
Andrei, Can you go into the settings / Multipage toolkit options page and click on the reset to default button. Just to clear the option settings in the database.
Another thing it can be is the visual editor cache javascript cache file is messed up, if you goto wp-content / uploads / js_cache and delete the file cache file, tinymce will generate a new one when you go in to the visual editor again.
Hei .. good work .. i was searching for something like this… well.. gotta serious problem.
am using wp 2.5.1 and no buttons showing… what to do now ?
I have a problem with preview. When I check the article in the preview mode before publishing, I can not see other pages (page 2, 3 etc.). Links like http://mysite/blog/?p=664/2/ are only showing the first page in the preview mode. Could you please fix it?
Hi Andrei, Have you got version 2.1? I made an error with folder naming with version 2.0 so I quickly uploaded another version (2.1).
Which version of WordPress are you running?
Sorry the plugin as it stands cannot do what you want.
You would need a custom plugin plus some code work in the theme to do what you want.
If your 4 section menu is the same for all your posts, I would create that menu in your theme – then have Introduction point to page 1, Pictures to page 2, Route to page 3, and Comments on page 4.
The other way to do it would be to modify my plugin, so that it creates the 4 section menu and only shows the comments on the 4th page.
Hi,
This plugin sounds nice. I want to use this plugin to plit posts into 4 sections max:
Introduction | Pictures | Route | Comments
I wanted to use the tabs plugin, but that one is unstable. Do you reckon I could use this plugin to create a horizontal in-post menu? I can imagine adding comments to a separate tab could be pretty difficult, but really hope it is possible.
Thank you
Pingback: Wordpress Plugin : Multipage Toolkit 2.1 » Tarkan Akdam’s BORED
Can this be made to work in the “Main Index Template”?
Hi,
I have sent you an email, if you can reply with your single.php.
Hi.
I am trying out this plugin on one of my websites and I’ve decided to use where I would like it to appear on the post page. It works fantastic.
However, I am having difficulty getting rid of the default “Page 1, 2, 3” generated by the plugin and I’m hesitant to start deleting the code inside the plugin editor. The defaul “Page 1, 2, 3” is showing up in the most funniest spot after the comments and comment box section. I get about 20+ comments for most post and you can just imagine having to browse through all the comments to get to page 2, and then to do the same thing again to get to page 3. Can you let me know where I should start copying and deleting from the plugin code? Would really appreciate it.
I guess you don’t have a subscribe to comment button?
and I’m having difficulty getting rid of the default “Page 1, 2, 3” that appears at the end of each post.