• I use the following code to switch stylesheets for individual posts:

    @import url(<?php bloginfo('template_directory'); ?>/global.css);
    @import url(<?php
    if ( is_single('1') ) {
    bloginfo('template_directory');
    echo "/bg1.css";
    } elseif ( is_single('3') ) {
    bloginfo('template_directory');
    echo "/bgflowers.css";
    ...............
    } else {
    bloginfo('template_directory');
    }
    ?>);

    It works great.
    Now, as I try out more bizarre layouts I need to switch the index.php as well for individual post.
    Could this be accomplished with the above code or is there some similar and simple solution for this ?

    Also, I use Kafkaesqui’s “Get A Post” plugin to have a specific post in a different post.
    I wonder if this could be modified to “Exclude A Post” plugin as I would need a function like this.

    Thanks,

Viewing 3 replies - 1 through 3 (of 3 total)
  • Individual posts are not displayed on index.php – they use the single.php template.

    Exclude from where?

    Thread Starter Kassad

    (@kassad)

    Actually, I use only the classic theme with a global stylesheet and per/post stylesheet.
    I use the classic theme’s index file modified to display more posts like the following:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="storycontent">
    <ul>
    <?php // the_content(__('(more...)')); ?>
    </ul>
    </div>
    <div id="news">
    <div class="storycontent2">
    <ul>
    <?php the_content(__('(more...)')); ?>
    </ul>
    </div>
    </div>
    <div class="storycontent3">
    <ul>
    <?php get_a_post(12); ?>
    <?php the_content(__('(more...)')); ?>
    </ul>
    </div>
    </div>

    Please, have a look at the “Frozen Dreams” blog in my domain.
    Choose “Walking …where to ?” post #17.
    In a following post I want to use this “triptichon” but the left side would be a javasript scrollable pane with graphical scroll controls. That would be e.g “storycontent4”. It works fine on localhost but now I would need an other index file where I can omit “storycontent3” because it would spoil my previous posts where I use only two panes.
    At the beginning of my project I tried single.php but it was not viable for my purposes.
    Also, category based switching is not suitable for me.
    It may be a little “kinky” setup but it is what serves best my whims 🙂

    As for excluding post, I use “Recent Post” as a means of navigation.
    If I want to display an “original” post in one one my panes then I will have a “ghost” entry in the listing. That is what I want to exclude but it may be useful for other purposes, as well.

    Thread Starter Kassad

    (@kassad)

    Well, loose mind…. 🙂
    There was already three plugins for the purpose, waiting for activation.
    So, topic resolved.
    Thanks for your patience.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Switching index files’ is closed to new replies.