WordPress.org

Ready to get started?Download WordPress

Forums

3 column layout and 2 col layout any way to get 2 index files into WP? (7 posts)

  1. lokjah
    Member
    Posted 9 years ago #

    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.

    TIA

    lok

  2. lokjah
    Member
    Posted 9 years ago #

    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..

    thanks

    Happy New Year :)

  3. lokjah
    Member
    Posted 9 years ago #

    anyone, anybody...

    lok

  4. navid
    Member
    Posted 9 years ago #

    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 ?>" />
    ....
    </form>

    I hope I understood your problem... Good luck.

  5. lokjah
    Member
    Posted 9 years ago #

    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..

    THANKS!

    lok

  6. lokjah
    Member
    Posted 9 years ago #

    I also found something else http://wordpress.org/support/4/6721

    ryan says in that thread something about this:

    excerpt:

    ..."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...

  7. lokjah
    Member
    Posted 9 years ago #

    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:


    <?php
    ob_start();
    ?>

    and then ended my index with the replacement:


    <?php
    $page_source = ob_get_contents();
    $replace_this = "href="http://mysite.com/blog";
    $with_this = "href="http://mysite.com/newsection";
    $new_page_source = str_replace($replace_this, $with_this, $page_source);
    ob_end_clean();
    echo $new_page_source;
    ?>

    I did this as per the wiki page: http://wiki.wordpress.org/?pagename=HowTo%2FUseTemplatesInAnyDirectory

    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!.....

    but...

    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..

    SO CLOSE!

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.