WordPress.org

Forums

Creating pages from database content (2 posts)

  1. neanderslob
    Member
    Posted 3 years ago #

    Hi all,

    I'm new to wordpress and am sofar BLOWN away by what it has to offer (really; I'm like a kid in a candy store with this). Anyway, regarding my question, I'm trying to build a section of my site that offers an array of profiles of different companieis. Such profiles would contain some photographs, embedded video, descriptions of products etc etc. I have all this info saved in a database and would like to automatically create a profile for each company according to the fields stored in the database. I understand that EZ Empire Builder does this, but I'd figure that there must be a free plugin that would do the same. Can anyone help me out?

    Thanks in advance!

  2. brasofilo
    Member
    Posted 3 years ago #

    yeah, remarkable tool, the possibilities are... endless?

    you probably can use $wpdb->get_results
    i'm not sure if you can run any mysql query, or if it's limited to WP tables, in which case you could just simply duplicate your tables and put the wp table_prefix on them

    usually, for each site i do, instead of put my functions inside the theme's functions.php, i create a simple plugin and drop my functions there (so, you can swap themes freely)

    so, it'd be a case of writing a function that reads the DB and prints your desired html

    and then, much better than making custom template pages calling the function, it's better to write a shortcode that you can drop inside any content, i.e.: [profile id=1] would print all the profile page of the company with ID=1

Topic Closed

This topic has been closed to new replies.

About this Topic