• I’m trying to understand permalinks and static pages and have visited the codex, but I don’t think it’s clear enough – it’s almost expect that you understand what is being done, rather than explaining what is being done?

    I want my site to display the about link as https://sekhu.net/wp/about If I enter that URI it actually displays the page, at the top however it displays as index.php?id=x why is this?

    I did update the permalinks for the links, about and archives. If I click on archives, it will displays the same URI as above with a different id, clicking on an archive month will display the masked URI of archives/month/day/year.

    Can someone explain the understanding behind this better than the codex and how it works with static pages, and basically how to make it display as such. I know my files are protected with the id=x but a the same time, would prefer the links to be “cleaner”

    Thank you

Viewing 15 replies - 1 through 15 (of 17 total)
  • How are these links setup in the Obsidian theme’s template?

    Since going to /wp/about/ works, it sounds like they’ve either been manually added, or if using wp_list_pages to pull them up they’re not being given the correct permalink url.

    Thread Starter jinsan

    (@jinsan)

    they’re set in the theme as id= as far as I can tell. I guess it doesn’t matter. I think I might quit on WP anyway.

    But appreciate the response.

    If the links are hardcoded with “id=…”, you can just change the hardcoding to “about” or whatever. More robustly, you can look at wp_list_pages, as Kafkaesqui suggested, to see how to generate this list automatically.

    Thread Starter jinsan

    (@jinsan)

    I’ll take a look, this how the code is in the header.php

    < div id=”hmenu”>
    < ul id=”top”>
    < li>< a href=”index.php?page_id=6″ title=”My Archives”>archives</ a>< /li>
    < li >< a href=”index.php?page_id=7″ title=”My Links”>links< /a>< /li>
    < li>< a href=”gallery” title=”Gallery”>gallery< /a>< /li>
    < li>< a href=”index.php?page_id=8″ title=”About Me”>about< /a>< /li>
    < li>< a href=”#bottom” title=”search in previous posts”>search< /a>< /li>
    < li>< a href=”wp-admin” title=”Site Admin”>Site Admin< /a>< /li>
    < /ul>
    < /div>

    I changed “index.php?id=” to “/about” and it gave me a 404 ??

    Hope that article helps…

    Try changing
    <a href="index.php?page_id=8" title="About Me">about</a>

    to

    <a href="about" title="About Me">about</a>

    without the leading slash before ‘about’ (it should work with the slash too, though… so I don’t know).

    And I don’t want to harp, but wp_list_pages is really the way to go :) – you wouldn’t have to hard code any of those links.

    If you achieve this please post it here. Im pulling my hairs trying to put a permanent link on the WP menu. https://www.ads-software.com/support/topic.php?id=22278 linking a static page.

    Thread Starter jinsan

    (@jinsan)

    excellent – who’d have thought no slash? Thanks for your help mdawaffe. I did look at Wp list btw, and it all seems like russian to me, just trying to understand is difficult let alone understand what all those php codes mean. To you it may seem plain English, but perhaps it might be a good idea to include examples of what each thing actually does.

    For most people the documentation may seem simple, but for the majority it’s quite difficult.

    Thanks again

    I would try replacing everything between <ul id="top"> and </ul> in the code you mention above with

    <?php wp_list_pages('title_li='); ?>

    The documentation is an evolving process, especially with stuff that is new to 1.5 like wp_list_pages. My suggestion would be to just try stuff out on your site. As long as you make copies of the files you’re about to change, you can’t break anything just by messing with template tags. See what works and what doesn’t. After that, if you feel you can make the docs clearer or more thourough, change them :) That’s why it’s a wiki, so users can contribute (in fact, it’s essentially only been users and not core developers who have contributed to the documentation so far).

    Thread Starter jinsan

    (@jinsan)

    I tried that, so I changed it to https://domain/dir/about in the paths and that seems to be working

    I’m going to try and revive this thread ??

    I’ve inserted the <?php wp_list_pages(‘title_li=’); ?> snippet in between the ul tags on my header.php template. I’ve also created a Page called “services,” including the slug as “services” too.

    It shows up quite nicely in my blue-leaves-10 theme as a services button on the left of the horizontal nav bar. But when I click on it I keep getting this error:

    The requested URL /index.php was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    Apache/1.3.34 Server at https://www.mysite.com Port 80

    Does this mean the mod_rewrite “thing” is not enabled on my server? I was pretty sure it was …

    BTW, am on WP 1.5 … tried upgrading from my host cpanel, but it didn’t work. And now I’m scared to try again for fear of erasing all the formatting I’ve done so far to my theme!

    Starting to get rather frustrated. Any help much appreciated. Thanks.

    1. Just having mod_rewrite enabled is not enough for the permalinks.
    https://codex.www.ads-software.com/Using_Permalinks
    + your own admin panel: Options > Permaliks

    2. When you do an upgarde you do NOT over-write the wp-content/ folder where your themes are!

    3. Don’t use cPanel. Do a manual upgarde.

    Ok, I was just kindly informed by a colleague that PermaLinks have little/nothing to do with creating my Pages (static). (But yes, I’ve set up my Options already for PermaLinks.)

    I’m still no further ahead with getting my Pages to work when I click on the links to them. Have tried a zillion different ways to reference the Page in the anchor tag (ditching wp_list_pages until I can isolate what the actual problem is …).

    Anyone else had this problem? I’ve found nothing on the web to help me and I no longer know if I’m even asking the right questions ??

    Thanks,
    Karri

    Checked out the troubleshooting tips at that Permalinks page?

    In particular, ensure your host not only has mod_rewrite, but also AllowOverride enabled.

    Windows or Linux host?

    Do things work if you make a custom permalink structure that starts with /index.php ?

    I’m investigating the mod_rewrite thing but wasn’t aware of the override one. Will check that out. And yes – I can reference the Page using index.php/?page_id=1 but that’s the ONLY way I can get a real link to the Page.

    Karri

    Well this might explain why I’ve been on this pointless merry go round for hours and hours (!)

    https://www.nosq.com/blog/2005/03/permalinks-broken-in-wordpress-15/
    https://www.ads-software.com/support/topic/23487

    (!!)

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘permalinks and static pages’ is closed to new replies.