Data from another DB as Post(Without inserting) or in a CPT array?
-
So I have queried out some data from another DB and obviously they’re not a
postwhich means I can’t use the standardpermalinkto link them to an existing page with it’spost type.
So I thought that if WP could just generate an let’s say “artificial” post ID to link to a certain generated page like any othercustom post type.So basically a generated page like when you do
the_permalinkbut for data from another database that is and will not go into the WordPress DB as apostor whatsoever, the question would be if this is possible?My code so far:
$result = $newdb->get_results("SELECT ".$column1.",".$column2." FROM ... LIMIT 1 "); <?php foreach ($result as $results) { echo '<li id="list">' ;?> <a href=" *answer should be here I think* "><?php echo $results->member_name; ?></a> <?php echo '</li>' ; } ?>
The topic ‘Data from another DB as Post(Without inserting) or in a CPT array?’ is closed to new replies.