Querying WP database from the outside, where are permalinks (1 post)

  1. Niklas
    Posted 3 years ago #

    I am connecting to another WP database by using

    $other_wp_db = new wpdb('my_wp_user','password_here','example.com');
    $results = $other_wp_db->get_results('SELECT ID, post_date, post_title, post_excerpt, post_name, guid FROM wp_posts WHERE post_status = "publish" AND post_type = "post" order by post_date desc limit 4', ARRAY_A);

    Is there any way I can get the permalink rather than the GUID?

Topic Closed

This topic has been closed to new replies.

About this Topic