WordPress.org

Forums

Static Pages (23 posts)

  1. fncll
    Member
    Posted 11 years ago #

    How can I create "static" pages that are edited by WordPress (and searched with the search engine)? For instance, for an /about/ section...
    In TextPattern I would create a new section and a template, and the "page" would consist of a single post that I could edit to make changes...
    Also, if possible I would want to exclude this from the RSS feeds!

  2. Mark (podz)
    Support Maven
    Posted 11 years ago #

  3. fncll
    Member
    Posted 11 years ago #

    Thanks. Wiki plug pages aren't included in the WP Search, as far as I can tell by testing on the site, so that's useless to me.
    The first suggestion follows along the lines of what I am already working on, I think, but I can't get the sample pages to see them and can't tell if they are included in the search.
    But there has to be a simpler way-- if someone hasn't written a plugin for this kind of need, I guess I'll probably do so.

  4. fncll
    Member
    Posted 11 years ago #

    The other disadvantage of method #1 is that it makes a static copy of the menu, which will have to be updated every time this information changes. The good thing about Txp sections is that they are in every way a part of the site and integrated so that the only updates you have to make manually are to the content. Thanks for the pointers, though.

  5. TechGnome
    Moderator
    Posted 11 years ago #

    fncll -- not really.... if you <del>follow</del> read the instructions, you'll see that I pulled it out into it's own file (menu.php) which I then include both in my main index.php and the static php pages. It's klunky, but it works for me and helps me to keep my index.php file down to a managable size too.
    And yes, since they are static pages outside of WP, they wouldn't be included as part of the search capabilities. A drawback, but until a better solution comes along, I'll live wiht it.
    TG

  6. fncll
    Member
    Posted 11 years ago #

    Ah, I didn't see that-- I was assuming that the include menu file wouldn't be updated by WordPress.
    However, it looks like the "fake folders" plugin might do what I need. I'm going to check it out more and I'll let you know.
    Having a search of the other pages is not a drawback or an inconvenience for me-- it is an absolute requirement. I'm *not* going to give user's two search engines to look for content!

  7. Tae
    Member
    Posted 11 years ago #

    fwiw, i'd love to see a plugin specifically for static pages. this functionality would allow me to use wordpress as a simple but real cms instead of just a blogging tool.

  8. Tinwelint
    Member
    Posted 11 years ago #

    A little idea i got:
    If you create a page, much like TechGnome's static "shell.php" where you make a call to a single wp-post (that is possible via the id or something I guess) but in the shell.php page remove all sort of calls to date, comments and the other stuff you wouldn't like in a static page.
    Wouldn't that create a static page that is searchable within WP (all posts are?) and editable via the admin interface?

  9. TechGnome
    Moderator
    Posted 11 years ago #

    fncll - I see your point, but it also depends on your needs. In my case, I had an "About Me" as a static page, along with a "Comment Leaders," "Recent Comments," and a "More Links" pages. The last three actually use WP calls to generate their content, but I can't put that kind of code into a post as it would never get run. In addition, I didn't want the content of those pages searchable, since it didn't make sense.
    It was a solution mainly for me, and I simply offered it as a possible solution to others.
    Tinwelint - in a nutshell, yes.
    TG

  10. Tinwelint
    Member
    Posted 11 years ago #

    But I don't know how to do it :-) . Anyhow I think I will use your (TechGnome's) static page method as I don't care wheter my page is searchable or WP-editable (a kind of about me page only).

  11. miahz
    Member
    Posted 11 years ago #

    Inserted Pages
    I haven't yet had time to try it out, but it sounds promising, and if it works, is probably just what i've been looking for - "static" pages that are normal posts within wordpress which can be edited and controled as such. Not sure if it fills your search engine requirement though.
    You should probably take a look at the rest of the article since that Inserted Pages section leans on some other sections, and there is also a screenshot that illustrates the new Post Status options in the Edit Post screen.

  12. fncll
    Member
    Posted 11 years ago #

    TechGnome-- I hope I didn't sound ungrateful for your help-- I was and am! It just so happens that at the moment I need the content searchable. Thanks again for your advice!

  13. fncll
    Member
    Posted 11 years ago #

    My posts keep disappearing for some reason...

  14. TechGnome
    Moderator
    Posted 11 years ago #

    fncll - no offence taken, and I never thought you sounded ungrateful. I jsut wanted to make clear up front that the content isn't searchable. I've had people try to implement it, *then* think about the content rather than the other way around. This method works for me since it allows my to run PHP through it, which I cannot do in posts.
    TG

  15. Anonymous
    Unregistered
    Posted 10 years ago #

    Just a thought...
    Couldn't you create static pages with htaccess? Theoretically, you can create a rule that assigns a specific post number to a url.

  16. TechGnome
    Moderator
    Posted 10 years ago #

    Phoat - yep, you could, in fact I've done some prelim work on some thing to do just that.... the problem is in getting it to NOT show up on the main page when you first enter the post. I've thought about backdating it, but that's kind of hokey.
    If anyone is interested, here's what I added to my htaccess file:
    RewriteRule ^static/(.*) /index.php?name=$1 [QSA]
    Now, I can do links like this:
    ht<b></b>tp://techgnom<b></b>e.anderson-website.net/static/about-me
    And it would take me to the post titled "About Me" (if I had one).
    I'm trying to figure out a way to sort of automate this via a plugin and a function that would list all "static" posts, and since they are posts, they are 100% searchable. The only thing I haven't done with it yet it to add the capability to run PHP in the post - which is one of the things I use static pages for, to generate the Recent Comments, Comment Leaders, and my Great List o' Links.
    TG

  17. chroniker
    Member
    Posted 10 years ago #

    I am wanting a static page also. How has all this turned out?

  18. moshu
    Member
    Posted 10 years ago #

    TG, what do you mean by "not searchable"?
    I went to your site, chose a phrase [code bitch] from your About Me page, went back to the main page, typed that string into the search box - and voila! the result is the "About Me" page :)
    I have an about.php page made in similar way (except I didn't put the menu part in a separate file) and doing a search for a word that was only in that page the result took me the my about page.
    So, I am confused when you guys are talking about anything not being searchable... Can somebody enlighten me?

  19. TechGnome
    Moderator
    Posted 10 years ago #

    moshu - my how the times have changed. That's because I no longer use that method for "static" pages. I've since moved on to this plugin that I wrote that uses WP posts instead of an outside file. It's cooler this way since now the posts are searchable (as you found out). What I described above has long since been replaced.
    Tg

  20. moshu
    Member
    Posted 10 years ago #

    OK, I got it, thanks.
    However it explains only the first part of my question, and still leaves me in darkness regarding the behaviour of my own site. But I can live with that :)

  21. Anonymous
    Unregistered
    Posted 10 years ago #

    i think 'Pages' lets you create searchable, static pages but I can't find any info
    on it besides whats been posted on the dev blog...

  22. moshu
    Member
    Posted 10 years ago #

    The "Pages" feature exists only in WP 1.3, and I am talking about the stable 1.2.1.

  23. TechGnome
    Moderator
    Posted 10 years ago #

    Not sure. I went to your site (btw, did you know that you do not have a background color set?) and added "About.php" to the end of the URL. Got the about page (I think) copied "Internationalization" from the page, went back to the main one, put "Internationalization" in the search box. I got one result... http://www.transycan.net/wp/archives/2004/09/30/language-philosophy-for-bloggers/
    If I click the "About" link, copy "Communication" from that page, then try to search, I get "No posts matched."
    ??? shrug ???
    Now, I do notice that if I search from the About.php page and there are no results, it doesn't go anywhere. It just stays put. If I then got back to the blog and search, then I get "no posts found."
    Tg

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.