Forums

Loading new posts in a PHP file with AJAX (6 posts)

  1. isJohnny
    Member
    Posted 1 year ago #

    I'm trying to make a way to load more posts without reloading the entire page, so I'm sending an AJAX request to a php file called get.php. That bit isn't the problem, it's the PHP. I just have no idea how to do it. I imagine there is some sort of file I have to include or something I have to do just to be able to use the loop, seeing as the get.php file isn't connected to the theme really.

    Thanks :)

  2. xRommelx
    Member
    Posted 1 year ago #

    learn PHP, if not this will be really complicate
    or learn something about CURL
    CURL will help u

  3. isJohnny
    Member
    Posted 1 year ago #

    Eh, I do know PHP, quite well in fact. I'm just wondering what file I have to include to get the loop and all that to work.

  4. Mark / t31os
    Moderator
    Posted 1 year ago #

    The examples shown here are relevant and easy enough to follow..
    http://codex.wordpress.org/AJAX_in_Plugins

    If you wanted the ajax to do a loop you'd simply code that into your ajax action's callback function..

    See the nopriv related info, it's relevant for doing front facing ajax stuff (ie. non-admin pages).

  5. isJohnny
    Member
    Posted 1 year ago #

    Okay, thank you, i didnt realise there was a codex page D:

  6. Mark / t31os
    Moderator
    Posted 1 year ago #

    You're welcome.. :)

Topic Closed

This topic has been closed to new replies.

About this Topic