• Resolved jpierre

    (@jpierre)


    Hey, I’ve read many threads so far but can’t find a solution to my problem. I’ve upgraded to version 2.0 all my sites that use WP. No problem with most of them. There is one however that is kind of tricky. It’s a site that I made 2 years ago for a customer, and that uses WP 1.0.1. No upgrading has ever been done. Now this site is not a blog (rather a galery for a painter). Accordingly, the “home” page (index.php) is a – true — static page : it does not use the loop, and its content is not in the db. There is however a page that uses the loop (featuring new paintings) that I named new.php and to which we get by a link in the menu.

    The thing is that I would like to integrate the site in the new theme system (WP 1.5 and up) so that I could proceed normally with all future upgrades. Now I keep having this problem with the “undefined function: get_header()”, no matter how I proceed. If my static home page (index.php) is in /wp-content/themes/my theme, then how could I link to the page containing the loop (named “new.php”)? And if the static page is in /wp (as suggested in some threads) then the problem is the same: how to link to the page containing the loop, if I want this page to be part of my theme? (By the way, the live site is in root, whereas the new installation (WP 2) is in /wp, where it will remain when all ajustments are done).

    So I am a bit at a loss as to where to go now. Am I making myself clear? Probably not. Here is the url of the actual site https://www.natureinarts.com

    TX

    JP

Viewing 9 replies - 1 through 9 (of 9 total)
  • The theme system doesn’t really like to have file names that are not “known” by the system, e.g. new.php.

    I assume you’ve already gone through the “make-your-style-a-theme” drill ??
    https://codex.www.ads-software.com/Upgrade_1.2_to_1.5
    and have a basic theme in place for the original design.

    Now in the theme system you can have a home.php in the theme folder and you can edit it (to have or not have WP thins in it, e.g. take out the Loop and insert your hardcoded content!)
    WHen the blog is accessed home.php takes precedence over the index (see Template_Hierarchy) and show whatever you have there. For the rest the index will be used.

    Thread Starter jpierre

    (@jpierre)

    Thanks Moshu, but then what would be the url of the new “index.php” that I have to put in the menu? If I provide the whole path (i.e. /wp-content/themes/my theme/index.php) I get a 404.

    Thread Starter jpierre

    (@jpierre)

    sorry… what I get is the

    Fatal error: Call to undefined function: get_header() in /home/danielle/public_html/wp/wp-content/themes/canevas/index.php on line 1

    What exactly do you intend to show on the index.php?
    Or, in other words: where do you want to go from the home.php?

    Based on the earlier version it seems new.php was showing the latest “posts”
    https://www.natureinarts.com/new.php
    right? seemingly manually inserting tables and other trickeries in ONE single post. Am I wrong? Question: from which category is this post?

    There might be different workarounds… depending on what exactly the structure of the content should be.

    Thread Starter jpierre

    (@jpierre)

    You’re right. Actually, the “new.php” is set to show only the last 2 posts. The most recent is from “equine” and the other from “north american wild life”. But this may change, depending on the latest pictures of the artist. If she comes with only 1 new paintimg, then I will set WP to show only the last post, whatever category it happens to be in. If she comes with 3 new paintings, all of diverse categories, then I will adjust WP accordingly. Does that answer your question?

    Partly, yes.
    Does that mean you are changing the number of posts shown all the time? Isn’t there some kind of pattern, pre-set rule in place?
    (Just trying to understand. If the artist comes up with a new picture or two… you have to go into the code and change it accordingly? What if you are not around?)

    And now thinking aloud:
    – What if you make a category called “new”?
    The most recent pictures posts would be posted to that category and, when a newer one comes in, simply uncheck/check the cat box in admin to move it to its “thematic” category.
    – This category might be excluded from being shown in the category list in the sidebar (if so desired)
    – where now the ‘new paintings’ link is, there should be a one-time handcoded link to this cat called “new”

    Would this help?

    Thread Starter jpierre

    (@jpierre)

    Does that mean you are changing the number of posts shown all the time? Isn’t there some kind of pattern, pre-set rule in place?

    Yes, but (1) she doesn’t come up so often with new paintings; and (2) it takes half a minute to change in the options. It is certainly not straight forward as a procedure, but it is what I found 2 years ago!

    – What if you make a category called “new”?
    The most recent pictures posts would be posted to that category and, when a newer one comes in, simply uncheck/check the cat box in admin to move it to its “thematic” category.
    – This category might be excluded from being shown in the category list in the sidebar (if so desired)

    That might be a good idea… But in that case, would my static home page be called “index.php”? I’ll give it a try and come back later. Thanks for your time.

    JP

    But in that case, would my static home page be called “index.php”?

    It depends. See the [[Template-Hierarchy]] link that I quoted already.
    I mean it depends on the files that you have in the theme.
    If you don’t have archive.php or category.php then the index is used for everything: displaying monthly and category listings, displaying serach result etc.
    Having something hardcoded in it (and not enclosed in an if_statement) would mean to display the hardcoded part everywhere!

    Thread Starter jpierre

    (@jpierre)

    It works. There are some ajustments to be made, but over all it’s perfect. There might be other problems, in which case I’ll come back later, but as far as this thread is concerned it’s resolved… I thank you so much!

    JP

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Integrating old WP 1.0.1 in the new theme system’ is closed to new replies.