WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] which file to include to call default wordpress functions? (6 posts)

  1. udaraaka
    Member
    Posted 1 year ago #

    Hi I want to directly call several WordPress functions (wp_insert_post(), wp_insert_attachment() and more ) from a custom php file. Which file(s) should be included in my php file (I mean using include statement) so I can call those functions directly from my custom php file?

  2. keesiemeijer
    moderator
    Posted 1 year ago #

    What do you mean by my "custom php file".
    You can call these functions from plugin or theme files.

  3. udaraaka
    Member
    Posted 1 year ago #

    thanks for your reply. well its a php file which resides outside of my wordpress folder. I am going to run this file using a cronjob to automatically insert the posts and their image attachments to my website. you know it is impossible to call wordpress core functions directly without importing those libraries so what is the include statement(s) i should put in my php file?

  4. keesiemeijer
    moderator
    Posted 1 year ago #

  5. udaraaka
    Member
    Posted 1 year ago #

    First option worked for me. Thank you very much.!!

  6. keesiemeijer
    moderator
    Posted 1 year ago #

    No problem :-)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.