WordPress.org

Ready to get started?Download WordPress

Forums

get_pages() together with Ajax (2 posts)

  1. keepthingsclean
    Member
    Posted 5 years ago #

    Hello everyone!

    I was doing some template modifications for a buddy of mine. He created a design concept that required somewhat of a dynamic navigation. So in brief what i want to do is to load the navigation and its content within an AJAX Request from a separate PHP file that echos a well formed HTML, containing the appropriate childs of a certain page.

    Now my question is, how to enable the PHP file to access the get_pages() function from WP. When i load my file as a plugin I can use all the native WP classes and functions but the file is executed everytime I open up a new page within the WP application. And since the file needs to have an "echo" in the end, I always have the output on top of everything.

    And hints for an Ajax and WP beginner how to solve this scenario?

    Thanks a lot!

  2. keepthingsclean
    Member
    Posted 5 years ago #

    Nobody able to help?

    The basic question is, how to access the get_pages() function from a new php file and where to store this file. Is it something that you'd file under "plugin" and how to do it then? Or is it more something that belongs to the theme? How to use it in this case?

Topic Closed

This topic has been closed to new replies.

About this Topic