WordPress.org

Ready to get started?Download WordPress

Forums

How to display what page # your on? (17 posts)

  1. mdvaldosta
    Member
    Posted 8 years ago #

    When using the next/previous links, the page title remains the same. I'm trying to insert the page number in the title so I'm not stuck with the same title on so many pages (bad for SEO).

    Is there a variable for the page number your on, that I can call?

  2. moshu
    Member
    Posted 8 years ago #

    That's basically the same webpage. You have the pagination only because you have set a number of posts in the Options . Reading panel that is smaller than your total posts.
    (not as an advice to try it - God forbid! - but if you set it to 999 you'd have one single page :)

  3. Sridhar Katakam
    Member
    Posted 8 years ago #

    What you need is pagebar plugin.

    http://elektroelch.de/hacks/wp/pagebar/

    You can see it in action at the bottom of my blog.

  4. mdvaldosta
    Member
    Posted 8 years ago #

    That's not what I need, what I need is a variable I can call in the page title to determine what page I'm on. This gives a better navigation, but nothing that I could use to append to the title for example <title>My Homepage - 2</title>

  5. Rok
    Member
    Posted 8 years ago #

    I don't exactly remember the site, but there is a plugin, which displays the current location of your browsing i.e. 'what page you are browsing?'.

    Google for this plugin, or if I recall the site address, will post here.

  6. mdvaldosta
    Member
    Posted 8 years ago #

    The breadcrumb plugin does that, but theirs no variable I can find to echo the page number into the title.

  7. Turk
    Member
    Posted 8 years ago #

    Check out Photo Matt, maybe Matt can tell us how to do that.

  8. wyrd33
    Member
    Posted 8 years ago #

    if (($page = $wp_query->get("page")) || ($page = $wp_query->get("paged")))
    {
    echo $page; // $page is your page number.
    }

    BTW my breadcrumb plugin displays page numbers:
    http://www.thedevproject.com/projects/wordpress-breadcrumb-plugin/

  9. Turk
    Member
    Posted 8 years ago #

    The code above seems only to work on the root of the blog. It doesn't add page numbers to Categories. I don't know enough about php to get it to do that.

    Matt's site shows page numbers any where there are more than one page. Categories and Searches being the big two that I've noticed. Also if it is page one there is no number. This is something I would like to do.

    I tried your plugin but it seems to output as a link. So in the <title> there is a the whole thing in the title bar the unparsed url and along with the page number.

  10. wyrd33
    Member
    Posted 8 years ago #

    turk: Yeah I realized as soon as I posted the link to my plugin. I'll have to adds support for title output another day. In the mean time, use the snippet of code I posted above.

  11. Turk
    Member
    Posted 8 years ago #

    I'll pass on that code. Until I can get it the way Matt's site is I'll just go without page numbers in the title. Thanks for the code though. I'll keep an eye for future versions of your plugin.

  12. wyrd33
    Member
    Posted 8 years ago #

    I updated the plugin today, and you can now easily display the breadcrumb in your title: breadcrumb_title(); - easy as that.

    http://www.thedevproject.com/projects/wordpress-breadcrumb-plugin/

    I also added quite a few options, so let me know if you spot any bugs.

  13. Turk
    Member
    Posted 8 years ago #

    That's a step in the direction I would like to go. But again it does not show in Categories and Searches. I would like the page number in both of those. I would like on anything with pagination.

    And as an option or something can breadcrumb_title(); be only the:

    » Page » 2

    in the title:

    Hotelblues.com » Page » 2

    If that makes any sense. I have a random title plugin that your plugin would stop.

  14. Turk
    Member
    Posted 8 years ago #

    Ignore the last few from me. I had a category.php in my theme that was causing the breadcrumb to be the default when displaying categories and searches.

    How would I stop it from showing Page 1 in the breadcrumb? I would only like the pages showing when it anything after the first page.

    Also how would I get searches to be:

    Hotelblues.com » Search » Search Terms

    and then page numbers?

  15. wyrd33
    Member
    Posted 8 years ago #

    See if the latest upload fixes your Page 1 problem.

  16. Turk
    Member
    Posted 8 years ago #

    Very nice thank you.

  17. wyrd33
    Member
    Posted 8 years ago #

    Sure no problem. As for the "search" and other text related titles for specific pages, I'm not quite sure how/if/when I'm going to handle that. I may add a few options like "search_title" or "author_title", but still unsure. I'll wait until I get some more feedback before adding those in.

    If you notice anything else let me know.

Topic Closed

This topic has been closed to new replies.

About this Topic