Forums

[resolved] How to use query_posts in functions.php (2 posts)

  1. LoneWolfPR
    Member
    Posted 5 months ago #

    I have a shortcode I created in the functions.php of my child theme. I have it set to query a specific category. I know there is a post in the category, but it keeps returning an empty query. Here's the code:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Am I missing something here, or is there a different way to do this in functions.php vs in a regular template file?

  2. LoneWolfPR
    Member
    Posted 5 months ago #

    Nevermind, figured out I needed to include the global $post.

Reply

You must log in to post.

About this Topic