Skip to:
Content
Pages
Categories
Search
Top
Bottom

AJAX & Template Tags


  • Erwin Gerrits
    Participant

    @egerrits

    This is my first dabble into AJAX so bear with me.

    I have in my template file a link with an onClick to a javascript funtion. The javascript function will, using AJAX, call an external php file to retrieve some data from a database and that php file will subsequently call a template tag to display the new data onto the template page.

    The problem is, is that the external php page has no access to buddypress/wordpress functions (or my template tags). It returns an error saying function soandso not found.

    Is there a wp_head() or something I need to call in the external php file to be able to access my template tag functions?

Viewing 2 replies - 1 through 2 (of 2 total)
  • I have the same issue, in part resolved but not at all.

    This is my experience and code:

    require_once ( $_SERVER["DOCUMENT_ROOT"] . '/social/site/wp-config.php');

    require_once ( ABSPATH . WPINC . '/pluggable.php');

    require_once ( BP_PLUGIN_DIR . '/bp-core.php');

    global $bp;

    bp_core_setup_globals();

    with this I am able to save a wire message via ajax in the db. But I’m not able to make bp return me the “graphic” instance of the just saved wire post.


    Erwin Gerrits
    Participant

    @egerrits

    Great! Thanks! I’ll noodle with this…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘AJAX & Template Tags’ is closed to new replies.
Skip to toolbar