• I’ve not sure about some coding as I’m no expert in php. What I’m trying to do is show a post content if a category is say ‘exeter’. If it isn’t then I’m just having a full stop. I have the following code:

    <?php if( is_category(‘exeter’) ) echo ”;
    elseif( is_category(”) ) echo ‘.’;?>

    However within that echo” I can’t see how to use this kind of thing within the php:

    <?php query_posts(‘p=96’); if(have_posts()) : the_post(); ?>
    <?php the_content(); ?>
    <?php endif; ?>

    It needs re-writing I guess but not sure how; any help appreciated!

Viewing 2 replies - 1 through 2 (of 2 total)
  • J M

    (@hiphopinenglish)

    You need to tell WordPress what to echo:

    <?php if(is_category ( 'exeter' )) :
    echo "This is working on Category Exeter";
    endif; ?>

    Or to give you an example of what I think you want:

    <?php if(is_category ( 'exeter' )) :
    query_posts('p=96'); if(have_posts()) : the_post();
    the_content();
    endif;
    endif; ?>
    Thread Starter pipedragon72

    (@pipedragon72)

    aha, simple as that hey? great, will try it out. thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘is_category php query’ is closed to new replies.