WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] On theme activation check for content and if not available install in database (4 posts)

  1. Philip
    Member
    Posted 3 years ago #

    hi WP forum members,

    i try to build an 'installer' for my theme but i can't find a solution on how to do this,
    i need on theme activation, a function will check for content and if not available it will install some sample content (pages, posts) in database,
    anyone here can help?

    thanks a lot!!!
    Philip

  2. elfin
    Moderator
    Posted 3 years ago #

    could you just check number of posts in the posts table?

  3. Philip
    Member
    Posted 3 years ago #

    thanks for the reply Rich,

    i'll take a deep look into your solution, to see what i can do,

    thanks

  4. Philip
    Member
    Posted 3 years ago #

    If anyone else want to do something like this,
    take a look at wp_insert_category.

    thanks

Topic Closed

This topic has been closed to new replies.

About this Topic