Support » Fixing WordPress » next_posts_link not working when inserted in a static page

  • Hi!

    I put the loop in a static page because I want to show there my last 10 posts.

    I’d like to include the navigation links so you can keep on reading the next 10 posts;

    ‘<div class=”alignleft”><?php next_posts_link(‘« next posts’) ?></div>
    <div class=”alignright”><?php previous_posts_link(‘previous posts »’) ?></div>’

    The problem is next_posts_link and previous_posts_link do not work. I guess they don’t because the link that they display is like;

    ‘wordpress/?page_id=15&paged=2’

    and I guess page_id=15&paged=2 doesn’t exit.

    How can I solve this issue?

Viewing 15 replies - 1 through 15 (of 19 total)
  • If by “static page” you meant a Page – it is not supposed to work.
    Don’t mix posts and Pages – they are meant for different things!

    “If by “static page” you meant a Page – it is not supposed to work.
    Don’t mix posts and Pages – they are meant for different things!”

    -> I need to do that because I converted index.php in a frontpage that is displaying what’s new in the whole web and an excerpt of the last post.

    I want to display my last 10 posts elsewhere like if it was a common blog. Any idea moshu? 🙂

    Is there anyway to link to next posts form a static page?

    No. Once you are told the template tag does NOT work in the setting you put it in (i.e. on Pages) – stop bumbing.

    Why bumbing? I’m just asking for a ->workaround<- in case somebody found any, a plugin or whatever. I DID recieve the message that next_posts_link doesn’t work in static pages. Take it easy.

    I’m pinned; if I make a home.php displaying what’s new in the web, index.php stop working and I lose my 10 entries blog.

    If I put the last 10 entries in a static page I lose the navigation.

    … and if I ask for workaround I’m bumbing?

    Moshu,

    Your reply was not helpful at all, especially when what Ganzua asked is actually possible. A little bit of searching through the WordPress Support forums, and even the web, would have yielded some results that you could have provided him to give a bit of assistance. Telling him to “stop bumbling” is fairly unprofessional.

    Ganzua,

    I was asking the same question a few days ago, and was somewhat frustrated that this isn’t an actual feature within WordPress. A static page with dynamic content seems to be a great idea to me, and suits the needs of my site perfectly. Here is what I found:

    http://www.transycan.net/blogtest/2007/09/10/static-frontpage-combined-with-dynamic-content/

    The above link will explain, and provide code, for a specific page template you can use to have page content mixed with category listings, or in my case, page content mixed with category posts.

    However, I ran into an issue where the post content would exceed the amount I had set for each page, and the following page would display the same content as the previous page. It would appear that a fellow moderator of Moshu’s going by the name of Kafkaesqui, was asked this question a year ago, and he provided this answer:

    http://wordpress.org/support/topic/57912#post-312858

    I hope this helps.

    Hi Dysantic! It is very kind of you, thanks a lot!

    🙂

    Hi Dysantic.

    This thread was 4 months old. Ironically, the transycan site you cited is moshu’s. The same fellow you chastised.

    As you might suspect, capabilities and knowledge can change over time.

    “This thread was 4 months old”

    …and it is great that someone took the time to answer and that he even sent an email to me.

    The workaround to my question is explained by kafkaesqui, in a thread that I didn’t manage to find when I did my research before I asked, not in moshu’s page.

    “The same fellow you chastised.”

    The same fellow that accused me of bumbing and eased my willing to ask again anything in here if it wasn’t because users like Dysantic.

    I really don’t understand your reply.

    I really don’t understand your reply.

    And it wasn’t addressed to you 🙂
    But you’re welcome to reread it.

    It was more to point out irony than anything else. I’ll try again if it helps.

    4 months is a long time in the software world. Software evolves, people learn new things.

    The first link that Dysantic gave you was written by Moshu, almost 4 months after this topic was created.

    Does that help clarify? Key words I’m going for here are irony and evolution. That’s all. No chips on shoulders. No flames.

    HandySolo,

    Yes, actually, that is ironic that one of the sites that I mentioned is actually maintained by Moshu. I’d say “small internet”, but that doesn’t have the same effect as saying “small world”. 🙂

    However, I was fairly disappointed by Moshu’s earlier response, regardless if he/she eventually created a work-around that I personally find useful (BTW, thanks Moshu).

    The issue that Ganzua was experiencing could have been resolved four months ago by providing Kafkaesqui’s answer (which is a year old), instead of the response he/she provided. Understandably, I’m sure the WordPress forums are a huge database of information, but it never hurts to even suggest to look further instead of a snotty “No. Once you are told the template tag does NOT work in the setting you put it in (i.e. on Pages) – stop bumbing.”.

    In the end, this resulted in Ganzua losing some faith in the WordPress forums. While Ganzua is only one person, another major factor is word-of-mouth, which WordPress relies on for it’s status as the best blogging tool available (which I still believe). But, as you can see from my original reply, a moderator’s response didn’t sit well with me and also prompted me to try harder to find an answer for Ganzua (and at the same time, fix an issue I was experiencing too as I didn’t accept that this was impossible).

    While I am thankful for the time that the WordPress moderators offer to assist those in need, at the same time, responses like the one Moshu originally provided don’t properly represent the standard response one can expect from a question posted in the WordPress Forums, and that should be known, and perhaps, addressed.

    Just my two cents, without a grudge, and a huge thank you to those who are responsible for WordPress and it’s continued excellence.

    4 months is a long time in the software world. Software evolves, people learn new things.

    Here’s the beauty of it all: If you don’t care for how things are going here, you can roll up your sleeves and join in! Thankfully, anyone can participate and answer questions (you have no idea how thankful we are for that too :-).

    Nobody is paid and we’re all volunteers. We (inclusive) all control the way support works here. Join in!

    lol – Perhaps I might, HandySolo. Thanks for being a good sport. 🙂

    Ganzua, did Kafkaesqui’s answer resolve the issue you were experiencing?

    Handsolo

    “And it wasn’t addressed to you :-)”

    well, sorry

    “But you’re welcome to reread it.”

    and you are all the way welcome too, obviously english is not my mother tongue and I’m probably misunderstandig anything. As far as I understand I asked how to link to previous entries using next_posts_link from a static page and in moshu’s web page there is an explanation of how to set a static page as front page which it’s not the point if I’m not wrong.

    “It was more to point out irony than anything else. I’ll try again if it helps.”

    no acridity here, no flames, just a next_posts_link question. I catched your irony and I’m not disturbed, I simply thought it was not well addressed. And this one is not a bad tempered man, all the contrary. Sometimes I wish I could exchange some points of view with Matt about wp and this forum since we both are musicians and perhaps we understand each other better 😉

    “Key words I’m going for here are irony and evolution”

    key words in this side of the sea are that I din’t want to bumb or annoy to anybody, just to find a way/workaround to make next_posts_link work in a static page, that’s all. I really didn’t find fair that Dysantic is chastising and this one is bumbing.

    Dysantic

    Thanks again for your replay and for your email, I have to test further because my custom theme is quite modified now. I’ll report if I manage to make it work and how 😉

    …and by the way, if you have any question that you think I resolved in my web feel free to ask me by mail or whatever, ok?

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘next_posts_link not working when inserted in a static page’ is closed to new replies.