Problem with the single.php header (4 posts)

  1. maisteriharju
    Posted 7 years ago #


    I'm using WordPress in slightly unconventional way. First of all I'm making website which has two language options (English and Finnish) and both languages has different header. The header includes the navigation. When you click the the british flag the header and navigation changes into English. This is nothing new.

    What is new is that this website has also very simple gallery. I'm using WordPress posts to make little galleries. Each post is one gallery. The gallery itself has been pulled together with archives-function which I found to be the only way to have two different templates for posts.

    Now the problem is this:
    When I open one gallery (or post) from the archives it opens on single.php -template. It shows only the default header (Finnish header) even if I'm coming from the archives which has the Enlish header. This is obvious because the links from archives point to http://www.mydomain.com/?=px (x as the post number).

    I really can't figure out how to have the single.php to have different header which changes according to whether you are coming from Finnish part of the site or the English part.

    Conditional tags won't help me with this because the posts are only in one category. I can't make two different categories because then the person who updates the galleries should make two galleries instead of one and it's just too much work.

    If any of you understood the situation and knows something which could help me with the problem, please comment.

  2. adamh
    Posted 7 years ago #

    Could you set a cookie or session var to the current language and then just have a switch in the header.php that displays the relevant header?

  3. maisteriharju
    Posted 7 years ago #

    Hmm.. I could do that if I just could. :) I haven't ever done anything with cookies or session vars and I don't know much about them. Is there some quick tutorial about this?

  4. adamh
    Posted 7 years ago #

    The php manual is a good start


Topic Closed

This topic has been closed to new replies.

About this Topic