The MU forums have moved to WordPress.org

theme works on main page but not post pages (13 posts)

  1. cclinton
    Member
    Posted 16 years ago #

    I built my own theme, loaded it and it only works on the main page. When I click on the post page the theme doesn't pull the css properly.
    as an aside, it worked fine with WP stand alone. Also, my theme is single page oriented versus the various pieces of the page like some themes. In other words, the code for the whole page is laid out in one page rather than separate the sidebar, header and footer.
    Ideas?

  2. cclinton
    Member
    Posted 16 years ago #

    Sorry, I should have mentioned a couple other things:
    1) viewing the page source for both the index page and the post page shows the links to the css properly. Thus both are pointing to the correct spot.
    2) the post comes up correctly, just not the CSS scripting.
    3) when I drew up the theme for my old stand alone WP, it worked fine for both the index page and the post pages.
    4) I am comfortable with PHP, scripting, html, etc.

    With this in mind, did I miss some vital difference between WP and WP MU in regards to limitations or requirements on a theme?

  3. andrea_r
    Moderator
    Posted 16 years ago #

    Nope, if it worked in regular WP, it *should* work in MU right off. Got a link?

  4. cclinton
    Member
    Posted 16 years ago #

  5. cclinton
    Member
    Posted 16 years ago #

    Additional clarification: I don't have all of my css in the script in the theme folder.
    I have the minimum required for the theme script in the theme folder. The rest of the css is in the main site folder as it covers my community section, my shopping cart and my main site. This did work in Wordpress stand alone. Now that I am using MU it seems broken, but only on the post pages and category (multi-post) pages.

  6. andrea_r
    Moderator
    Posted 16 years ago #

    Are you pulling in another stylesheet from somewhere else? Because the one at http://promechanics.net/community/wp-content/themes/promech/style.css, which is listed in the source of both pages, contains nothing but a couple lines.

    Which would be your problem....

    Okay, so on the main page, it's also pulling in the css from here:
    '< link rel="stylesheet" href="../pmmain.css" type="text/css" media="screen" >'

    Copy the stuff in pmmain.css into style.css. When you get into the sub-pages, the relative links break. that's why the styles go bye-bye.

  7. lunabyte
    Member
    Posted 16 years ago #

    Or just replace the style declaration with the right path to your css file. The theme doesn't "have" to call the style.css file, although it has to be there (in the theme dir) to use the theme.

  8. cclinton
    Member
    Posted 16 years ago #

    Thanks for the suggestions. The style declaration does include the right path to the css file and it has been checked a couple times to make sure it works. It did work with WP stand alone. I guess I will have to add a copy into the themes directory or add the comments to the style.css file. I was hoping to avoid this as I didn't want to have to remember to modify a bunch of CSS files each time I make a modification to the theme for my whole site.

  9. andrea_r
    Moderator
    Posted 16 years ago #

    Or put in an absolute link to the extra css file, as it's horking on the relative link.

  10. lunabyte
    Member
    Posted 16 years ago #

    Or just replace the style declaration with the right path to your css file. The theme doesn't "have" to call the style.css file, although it has to be there (in the theme dir) to use the theme.

  11. cclinton
    Member
    Posted 16 years ago #

    Andrea_r - I like the idea of an absolute link as it won't matter where we are on the site.

    Lunabyte - I am not sure what you mean changing the style declaration to the right path to your css file. As far as I know it was and still is pointed at the correct path.

  12. andrea_r
    Moderator
    Posted 16 years ago #

    lunabyte - he's pulling in two links to two stylesheets - one in the theme folder adn one in the root. the link to the root one is relative, like ../name.css, so the permalinks going more thna 2 folders down hork on it.

  13. lunabyte
    Member
    Posted 16 years ago #

    If the main style sheet (with get_stylesheet) is blank, change that path/function to instead point to the actual css file you want. Use the blog url, then type in the path.

    Relative paths aren't an option.

About this Topic

  • Started 16 years ago by cclinton
  • Latest reply from lunabyte