Help with a php echo and category number (1 post)

  1. knight42
    Posted 7 years ago #

    Hey everyone
    (hope this is in the right forum!)

    Am trying to echo category numbers from the functions file.

    Where $myString="6" in the functions file (6 being the cat number.)

    It works in the following code on index.php

    <a href="<?php echo get_category_link($myString);?>"><?php echo $myString; ?> </a>

    But I cant get it to work in a loop query. I thought this would work.....

    <?php query_posts('cat='<?php the_category($myString); ?>' &showposts=10'); ?>

    But it doesnt. Would anyone have any ideas? Im really stuck as my PHP is pretty bad!! Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic