WordPress Plugin : Multipage Toolkit

WordPress Plugin : Multipage Toolkit

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 3

TA_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.

126 thoughts on “WordPress Plugin : Multipage Toolkit

  1. Tarkan Post author

    Hi John,

    I have had a look at doing this and sadly it is one seriously difficult thing to do. HTML title is actually pulled from the database outside of the wordpress loop.

    The only way would be to actually store the page titles in the database and pull them outside of the loop.

  2. JTPratt's Blogging Mistakes

    In your first page description it says that the plugin will give the ability to create both headers and titles for multiple pages, but in fact it only gives the ability to do a header. It doesn’t update the HTML title at all, which is very, very bad for SEO and SERP’s since multiple pages will have the same name (but different content). The “pagetitle” comment only uses it’s content on the page for navigation elements created by your toolkit.

    Is there a way to update the actual HTML title of the page (and override the original one) on the multiple pages?

  3. Tarkan Post author

    Alex,

    Thanks for the feedback!!!

    When I last looked at creating a button in tinymce it did not look too difficult but with the upcoming release of 2.5 and the changes to tinymce – I decided to leave it.

    One thing that has always bugged me is that wordpress by default does not include a button for nextpage!

    I will have another look at it, so please stay tuned…..

  4. Alex Leonard

    Do you know what would be amazing (as I’m loving this plugin), is there any chance you’d be able to work out adding in a tinymce editor button with the functions available.

    Eg. One button for “Insert Next Page Break”
    and
    One button for “Insert Paged Title” or something along those lines.

    This would just make it that little bit easier for people scared of the HTML view.

    I like the way that Oliver Siedel has worked in that functionality for the Cforms plugin, and if you check that plugin out I think you’ll see what I mean – perhaps it would be easy enough to borrow his code to gain the intended effect?

  5. Tarkan Post author

    Sorry Walt I misunderstood you.

    Yes, of course it can be used on page posts (my example page is a page post http://www.tarkan.info/archives/multipage )

    and yes with some CSS styling you can make it look however you want. I have basic looking tab style with my page title navigation bar (see my example page) you can use that as a starting point.

    For a proper tabbed look you can always create some background tab images and CSS to style them.

  6. Walt

    Hmmm. I’m probably not explaining myself well. When I say “page”, I’m talking about a “write page” page rather than the entire blog page or the index/posts page (like the plugin you referenced seems to address). The kind of pages I’m talking about would be an About page or a Contact page. (Perhaps there would be less confusion if WP had named it a “perma-post” or something like that. I’ve had enormous difficulties searching the plugins database using “page” in the seacrch terms).

    Anyway, I have such a “page” the uses the functionality, and I thought perhaps I could dress up that page’s navigation using your toolkit. As it is, I really don’t want to mess with the templates too much, but I will if necessary. What I need to know is can your paging functions be styled to look more like a tabbed interface?

  7. Tarkan Post author

    Giovanni, a previous commentator noticed – looks like WordPress is turning double dash in to a single long dash.

    The code you need within your posts is < ! - - nextpage - - > notice the double dashes, no spaces.

    I have sent you an email with the correct formatting for the nextpage and pagetitle quicktags.

  8. Giovanni

    I really can’t install your plugin.

    I inserted the code but nothings happen with my template.
    I’m using the gallery feature on wp2.5
    it’s not working…
    if you could help me thank you:)

  9. Walt

    I have a number of questions if you don’t mind 🙂

    Will this code work with pages as well as posts? This is what I need – a front page that is actually made up of multiple pages (page 1,2,3 etc). Preferably using tabs at the top for the individual page numbers.

    It sounds like your plugin can do this (perhaps with CSS styling?) for posts, but will it work for a page?

    Thanks,
    Walt

  10. John Pratt

    Having the same problem as the earlier person, I’ve placed the comment code in a post to break up the page and then your sample code in single.php and it doesn’t work at all. I hack and design themes and work with a lot of plugins, and in fact I was writing a post describing how to make your plugin work – and I can’t get it to work in my blog at all. I’m using WP 2.3.3. Please email as soon as you can so I can show you where it doesn’t work and the code I used (just your example code). The sooner I hear from you, the sooner I can finish my article and send you some link love.

    thanks!

  11. Tarkan Post author

    It would depend on how your related post and tags are inserted.

    If the plugin themselves insert the code in to the end of you post automatically then it will not be possible.

    I have sent you an email if you can reply with your single.php attached I can have a look to see if it is possible or not.

  12. Pingback: The Best Blogging Software (WordPress) + The Top 60 WordPress Plugins | Midas Oracle .ORG

  13. rub

    Thank you very much for your reply, and sorry for the email adresse problem..; this one will work.

    So I tried on the comments section of your blog to explain my problems, but comment don’t accept code sample… even the contact form don’t..If I put HTML ou PHP code it desappears… Ive tried also by contact link form but impossible to explain my problem precisely… contact form also reject code samples. How can I do to show code ?

    Basically I tried yo use the Function TA_content_jump option . I think I put the right code in the article, also the right one in single.php side (in my activated theme folder) inside the Loop. I don’t use the basic one but Technology wordpress themes made by 786dir.org/

    I tried to use your plugin on articles and also on pages, in local and also in remote WordPress configuration.

    I spend already fews hours, and as I am a designer, not a programmer still asking to myself what I doing wrong 😉

    Thanks

  14. rub

    Hi,

    1/* I installed and activated your plugin

    2/ I’ve put the following codes inside my pages :


    my first paragraph here…

    and
    my second paragraph here….

    and so on…

    And then I put inside the single.pphp template
    But it doesn’t work.

    Any advice/idea ??
    Many thanks

    Do your plugin support both wordpress articles and pages ?

    sorry but my previous poste didnt take the code. I must post it again

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.