• TechGnome

    (@techgnome)


    There have been several requests to have “static” pages that could be linked to from the main index page. I’ve found a way to do it that was fairly painless. I’m sharing the experience in case it helps anyone else, or if some one wants to take the idea and expand on it.
    In rearraging my site, I found my self with the need to create static pages…. well, they aren’t 100% static, but I wanted to display content that was not part of the blog. At least they weren’t part of the blog postings. My links got out of control, and so I removed them from the menu, but I still wanted to have them listed somewhere… So…. I took index.php and started to gut it…. I took everything out from between the <div id=”content”> </div> tags, then removed the foreach that appears between the opening rap div tag and the opening content div tag. I then saved it. That became my template. I then stuck in the PHP code to list links within the content tag. Saved it as links.php, and added it to the menu on index.php. And it worked.
    That’s when I noticed a “problem.” The link was on the index page, but not on the subsequant links page. OK, I’ll admit, I’m a lazy bastard. I knew I had more of these kinds of pages to add…. I only want to do this once. So… I cut the entire menu div tag section out, and put it in its own file: menu.php. Then I edited each of my pages, removing the menu div section, replacing it with a include pointing to the menu.php file. Now, when I make a change (once) to the menu, it gets updated through out the entire site.
    I thought about doin the same to the header portion, but that doesn’t change, and now that I have a template shell, is easily created when adding pages. The end result are three new pages that will be as dynamic as the main page, and yet has the option of being totaly static. And since the static pages fall within the WP templating, the CSS style switcher will work on all those pages as well!
    If anyone wants further info, or a copy of the shell I created, just let me know.
    TG

Viewing 15 replies - 1 through 15 (of 15 total)
  • bakshi

    (@bakshi)

    I have been recently adding pages to my WordPress that have zFeeder included in them. Are you talking about something like this?
    My Recent Newsfeeds – https://bakshi.us/blog/feeds
    My Moblog – https://bakshi.us/blog/mobile
    If it is… I THINK I MIGHT NEED IT! ??

    Thread Starter TechGnome

    (@techgnome)

    Uh-huh…. If you visit my site, in the menu, just above the calendar are three links, one for Links, one for Recent Comments, and one for Comment Leaders. Each of those links use this technique.
    TG

    Anonymous

    Where is the link to your site so we can take a look at it?

    NuclearMoose

    (@nuclearmoose)

    @anonymous,
    One possible way to find the site for any member is to click on the MEMBER hyperlink below each person’s name in the left-hand column of this forum. You will be taken to that person’s profile page. I think that *most* people have supplied a link to their sites from the profile page.
    This is TG’s site.
    HTH.
    Craig.

    Thread Starter TechGnome

    (@techgnome)

    *slaps forehead* D’oh! Hehehe…. I gues I should have supplied a link. Thanks for saving my arse NM!
    TG

    NuclearMoose

    (@nuclearmoose)

    @tg
    Any time, bro!

    czar21

    (@czar21)

    @tg
    Would you mind sending me the shell you’ve created… I’d like to take a look at it… [email protected]
    I’ve been wanting to move to WordPress for a long time, but I need support for some static pages… If this works for me, I’ll jump on the table and do an Irish jig ??
    Thanks,
    Colin

    Thread Starter TechGnome

    (@techgnome)

    czar21 – sure thing. What I’ll do is package it up into a zip, and post it on my site and put the link here.
    TG

    This works…but I have a (potentially) stupid question.
    Is there a way to edit those static pages with the editor?
    (I realize you can edit the html file, but I am settting this up for someone who doesn’t know any html; it would be handy to use the editor for bold, italics, etc.)
    Thanks!

    Sorry if this comes off as rude, but you should check out my plugin Faked Folders. It uses WP’s own CMS for editing, so adding/updating content is just like a post’s. You can also assign specific templates and plugins to folders so they act nothing like your weblog… Or as an exact clone of it… ??

    I’ll check that out…thanks!

    Okay…obviously I’m a complete noob here, but I can’t get this working. These are the steps I took:
    1] installed it correctly (I think!)
    2] set up a ‘faked-folder’
    3] added drafts to the faked-folder.
    4] “set” one of the drafts (this sets the draft as the ‘index’ for that folder, right?)
    My assumption was, if I created a faked-folder called “testing”, I could find the draft I associated with it by going here:
    https://www.mywebsite.com/testing/
    Maybe I’m just tired…maybe I need a beer… i dunno.
    Any help would be appreciated!

    Hm… Is your WP install in the root directory? Would https://mywebsite.com/ pull up your weblog? The URIs are relative to the WP install. Also do you use a .htacess file for your permalinks? The plugin is tied to it at that file moment. If that doesn’t solve it, then can you send the re-write rules on the plugin’s main page?

    uhm, I am not using .htaccess for my permalinks…in fact I don’t even know what that is.
    Sorry…I’m new to all this bloggin stuff!

    Hello,
    First off, thanks for your help.
    I don’t have WordPress installed on the root. It’s in a folder called “WordPress”.
    Here are the re-write rules:
    # BEGIN FAKED FOLDERS RULES
    RewriteRule ^testing/([^/]+)/?$ /index.php?static=true&template=1&name=$1 [QSA]
    RewriteRule ^testing/?$ /index.php?static=true&template=1&p=2 [QSA]
    RewriteRule ^anothertest/?$ /index.php?static=true&template=1&p=4 [QSA]
    # END FAKED FOLDERS RULES

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Static pages…. faked….’ is closed to new replies.