Forum Replies Created

Viewing 3 replies - 16 through 18 (of 18 total)
  • Thread Starter lees69

    (@leeshields)

    OK

    I’ve solved the bug in this template, but I dont know why!

    WP here is just for CMS, when I created the static page above I was able to delete bits of HTML easily and find the culprit

    I deleted <!– <?php trackback_rdf(); ?> –>

    And it seems to be working correctly now

    What a mare! I’d still be very grateful if anyone could shed some light please?

    Thanks

    Lee

    Thread Starter lees69

    (@leeshields)

    Just to update

    Here is a static page

    This is the copied source code from the wordpress page saved into HTML and uploaded, no loop etc involved

    http://d756399.a247.apogeedns.com/index2.php

    Thanks

    Lee

    Thread Starter lees69

    (@leeshields)

    Would this work outside the loop?

    I’ve just got my code to work by running a loop first, but I’m not sure if its wise,slow etc

    The page actually works correctly (there is unnec code in there, I was hoping to make this a drop in for various pages without haveing to custom code)

    <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
    <?php
    $postid = $wp_query->post->ID;
    $category = single_cat_title("",False);
    if($category == "") {
    	$categoryarr = get_the_category();
    	$category = $categoryarr[0]->cat_name;
    }
    $banner = get_post_meta($postid, 'header', true);
    ?>
    <?php if($banner != "") { ?>
    <img src="<? bloginfo('template_directory'); ?>/banners/<? echo $banner ?>" alt="<? bloginfo('name'); ?>" />
    <? } elseif($category == "Community") { ?>
    <img src="<? bloginfo('template_directory'); ?>/banners/community.jpg" alt="<? bloginfo('name'); ?>" />
    <? } elseif($category == "Mercury") { ?>
    <img src="<? bloginfo('template_directory'); ?>/banners/mercury.jpg" alt="<? bloginfo('name'); ?>" />
    <? } else { ?>
    <img src="<? bloginfo('template_directory'); ?>/banners/banner1.jpg" alt="<? bloginfo('name'); ?>" />
    <? } ?>
    <?php endwhile;?>
    <?php endif; ?>

    Thanks

Viewing 3 replies - 16 through 18 (of 18 total)