• Hi,

    Per this article http://codex.ww.wp.xz.cn/Template_Tags/query_posts I am trying to pull posts from a category using the category name, but I am trying to use a php variable generated elsewhere to insert the name of the category. So my code looks like:

    query_posts(‘category_name=$variable’);

    But this isn’t working. Can anyone help?

    Thanks,
    Mike

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Using a variable to pull posts from category’ is closed to new replies.