• Resolved freshifreshy

    (@freshifreshy)


    I want to create a php file that queries the database for posts, then I want to call on that php file with ajax to load in that content.

    I was hoping to do this without having to create a page and assign it a template, but it seems that if I don’t do this, I can’t use WordPress’ query tags, etc.

    I’d like the PHP file to be as unobtrusive as possible.

    What would be the best, most secure way to do this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter freshifreshy

    (@freshifreshy)

    I guess what I’m asking is: Is there a way to take advantage of the WordPress codex for querying posts, etc., but without having to assign a template to the page?

    Thread Starter freshifreshy

    (@freshifreshy)

    I think I’ve discovered that the answer is no. So instead I’ve used

    if ( is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" ) { 
    
    // do something 
    
    }

    Using this, I created the page I need when the template loads.

    Was hoping to get around this, but ah well.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Query database without get_header() ?’ is closed to new replies.