WordPress.org

Ready to get started?Download WordPress

Forums

Interested in using WP as a CMS (5 posts)

  1. nateomedia
    Member
    Posted 9 years ago #

    I have a website that has been completely coded and designed using xhtml 1.0 strict and css. It's got around 60 different pages, a global css file and about 8 or so local css files for the different sections (too keep bloat down on the global file). I would like to use WP to handle a few of the sections on the site as well as content on the main page. The program looks ideal -- I can use it to manage articles and lists and can even create custom fields for non-article content. And it allows me to handle all of the mark-up -- it just feeds me the content. (Having looked at TextPattern, Mambo, and others, I can't believe how many programs interweave content management with the html.)

    So I spent all day reading documentation and set-up WP on my Mac so I could fool around with it. No problem. Piece of cake. I read everything I could find about creating a theme, both here and through Google. I put together a basic theme, using my home page as the index.php file and breaking sections of it off into the header.php & footer.php and trying to figure out how to insert content dynamically into the layout.

    This is where I started getting stuck. I started by trying to figure out how to make links work -- for instance, I have a Support page that is styled differently from the index page that I wanted to try linking to the index page. As I understand it, there are two ways I can do this:

    1. I can create Support as a Page in the admin;
    2. I can create Support as a category and then have category.php hand off to my Support page using a query.

    Okay, I get that. What I don't get: How do I write the link to either one of these? Say I have this on my page:

    <a href="">Support</a>

    What tag do I put into the link? I can't find any tag on the WP tag page nor instruction in the template creation tutorials (or Page tutorial) that explains how to do this. I keep thinking I'm missing something -- where can I find this info?

    I also would like to know the best practice of how to link a stylesheet to one of my Page templates through the CMS (if I don't want it to be style.css). Should I just explicitly declare it?

  2. nateomedia
    Member
    Posted 9 years ago #

    Gah! So then, after all that hunting around, it turns out the answer is right under my nose, and that the very link I needed was here on this Support forum after all:

    http://codex.wordpress.org/Linking_Posts_Pages_and_Categories

    Maybe I just missed this, but I looked through all the documentation at the codex and never saw that page. I suggest linking to it more in other template docs.

    My other question still stands though: My understanding is that you can link css files to particular Pages through the admin interface -- how? I would prefer to use the same header file for all pages.

  3. Kafkaesqui

    Posted 9 years ago #

    "My understanding is that you can link css files to particular Pages through the admin interface"

    Not sure where you got that understanding. Couple things I can suggest looking into for this:

    1. Use PHP to test the Page one is on, and display the correct stylesheet based on that. However, this could involve a lot of handholding if you add pages regularly.

    2. A little solution I cooked up:
    http://wordpress.org/support/topic.php?id=31639#post-183318

  4. nateomedia
    Member
    Posted 9 years ago #

    Well, here's text from http://codex.wordpress.org/Using_Themes that seems to suggest that you can:

    Themes are a whole new ball game. Let's say you write a lot about cheese and gadgets. You could now have completely different pages for each category. In the Cheese category, you could have just the useful Cheese links, a nice image of some cheese for the header and you could still have the CSS alter the page presentation in any way you wish to. When your viewer then clicks the Gadget category, the whole page changes again. The page structure could change, the links, <b>the CSS</b>, the images - everything. You are limited only by your imagination.

    I must have read too much into that. I guess what I could do is have style.css = global.css and use a query to determine which secondary stylesheet would be added based on which category was selected, right?

    Pages, once set-up, should not change. Like I wrote, the site is done -- I just need a CMS to control it.

  5. Kafkaesqui

    Posted 9 years ago #

    Your idea on using a global.css and supplementing it with stylesheets by category (with a little PHP-based testing) could definitely work. Another option would be to use individual category templates and set up different headers in each, through which a different stylesheet is called.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.