want to link the posts on mywebsite back to it's own website where they live
-
I have a website and want to display posts from an external website on to my own website so every times the posts update on the external website, it will update on my website too.
I have managed to pull the posts from the external website on to my website, but now I want them so that when you click them from my website they navigate to the original posts on the original website.
Please see my code below:
<?php $mydb = new wpdb('root','','test','localhost'); $rows = $mydb->get_results("select post_title from wp_posts"); echo '<ul>'; foreach ($rows as $obj) : echo '<li><a href="'.get_permalink($obj->post_title).'">'.$obj->post_title.'</a></li>'; endforeach; echo '</ul>'; ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘want to link the posts on mywebsite back to it's own website where they live’ is closed to new replies.