urgent conditional formatting issue

  • Unknown's avatar

    Hi, this is the issue. I’m having trouble with a customized theme I’m working on. What I would basically want is for a certain category of posts (youtube movies only) to show up in the sidebar of the blog. For that, which is category 4, this is the code:

    <?php
    if ($posts) : foreach ($posts as $post) : the_post();
    ?>
    <?php if (in_category(4)) { ?>
    <div class=”asides_sidebar”>
    <?php echo $post->post_excerpt ?> <?php the_content(); ?>
    <?php the_time(‘d/m/Y’) ?> | <?php comments_popup_link(__(‘Comments (0)’), __(‘Comments (1)’), __(‘Comments (%)’)); ?>
    </div>
    <?php } ?>
    <?php endforeach; else: ?>
    <p><?php _e(‘Sorry, no posts matched your criteria.’); ?></p>
    <?php endif; ?>

    I’ve saved that as video.php and included it in the sidebar. Now, the theme has no post or page php’s, so everything’s done through the main index template, which has the following code to begin with, added by me:

    <?php rewind_posts(); ?>
    <?php if (is_front_page()) query_posts(“cat=-4”);
    if (have_posts()) : while (have_posts()) : the_post(); ?>

    The problem is that in any page or post, the video doesn’t show up. I would greatly appreciate any help on the issue, especially in terms of coding the proper way to display that video in the sidebar and NOT on the main page, regardless of the page, post etc.

    Many thanks,

    Drac

  • Unknown's avatar

    You need http://wordpress.org/support

    We cannot help here, sorry.

  • Unknown's avatar

    Any progress on weeding out the wp.org posters, Mark? ;)

  • The topic ‘urgent conditional formatting issue’ is closed to new replies.