Support » Fixing WordPress » 3 column layout and 2 col layout any way to get 2 index files into WP?

  • Hey there, I’ve got one install of WP (1.3alpha4). I’m displaying posts (by post id’s and cat id’s) on different sections of my site.

    My home page has a 3 col layout, and on that page I have it to display all the posts in a category for that page. This at the moment is the layout that I have for my “main index” page in the Presentation>Other files section of the WP control panel.

    On various other sections of my site I have a 2 col layout. On these pages just as the home page I display posts by post id or cat id. The problem comes in when I go to comment on one of these posts. Upon clicking the comment link, my post gets put into the “main index” template (the 3 col) instead of staying in the section where it is displayed with the 2 col layout.

    Is there a way to get this working on the 2 column pages?

    The only way I had it working a bit better was doing another wp install for the 2 col pages. But if its possible I’d like to stick to one install.



Viewing 6 replies - 1 through 6 (of 6 total)
  • Still not sure what to do on this, I tried the template name route but, really I’m not sure what strategy to use here

    I know it must be something really simple that I can do, if anyone knows I’d greatly appreciate it, as I’ll just end up doing multiple wp installs again, but i’d rather do it a more efficient way..


    Happy New Year 🙂

    anyone, anybody…


    It hardly appears you will need multiple installations of WP, but rather, you need to tweak your index so it recognizes where it is coming from (2-col vs. 3-col) and deals with it accordingly.

    There are probably a number of ways to do this; cookies, url parameters, etc. But probably the cleanest and best way to do this is using a hidden form attribute to pass the page style to the next page.

    It would probably look something like:

    <form ...>
    <input type="hidden" name="page_style" value="<?php $page_style ?>" />

    I hope I understood your problem… Good luck.

    hey navid, thanks alot for the help. could you explain a bit more how I would impliment this?

    it sounds like it would do the job..



    I also found something else

    ryan says in that thread something about this:


    …”You’ll either have to hand edit your rewrite rules or make index.php handle all of the different categories. index.php can be coded to output a different style for each category.”

    I’m not exactly sure how this is implimented, but I also am showing specific posts by id in certain sections where category alone I dont think would be sufficient…

    my head’s starting to hurt, i’m thinking its not that hard to do, I think my lack of wordpress vocabulary is part of my prob in searching for a solution…

    OK, I just got a semi breakthru.. wOOT!

    But I still have a problem…. I put the output buffer in on my two column page:


    and then ended my index with the replacement:

    $page_source = ob_get_contents();
    $replace_this = "href="";
    $with_this = "href="";
    $new_page_source = str_replace($replace_this, $with_this, $page_source);
    echo $new_page_source;

    I did this as per the wiki page:

    Now, progress was made in that when I click the “comments” link on an entry it loads the comments in my 2 column index… YES!…..


    if now I create a comment and hit “say it” I am then returned to the 3 column index where it displays the comments, taking me from my 2 column index again..


    any idea of what I could do further?

    maybe something with wp-comments-post.php? could I do something to that file, OR make a copy of it and put it into the directory where my 2 col index is and somehow make it work?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘3 column layout and 2 col layout any way to get 2 index files into WP?’ is closed to new replies.