Assuming each site is WP, they’ll both have RSS feeds. You’re better off just to fetch the RSS feed and get the latest post link from that.
WP even has some built in support RSS parsing!
<?php
/**
* An example of how to use fetch feed
*
* @uses fetch_feed
* @return bool|string False on failure, the permalink on success
*/
function wpse60754_fetch_feed($feed_url)
{
$feed = fetch_feed($feed_url);
if(is_wp_error($feed))
return false;
$items = $feed->get_items(0, 1);
if(count($items))
return $items[0]->get_permalink();
else
return false;
}
Related Posts:
- Query All users that has post
- Inner join overrides Advanced Custom Fields plugin’s get_field [closed]
- Queries take 120+ seconds on my large WordPress site
- Return records between two meta datetimes saved as strings
- Query to fetch custom taxonomy along with post title
- How to limit the number of posts that WP_Query gets?
- Should we trust the post globals?
- Random sort within an already sorted query
- how to get a different html for odd/even posts?
- MySQL Query to Retrieve Category from wp_posts
- SQL Query for getting all posts in their latest revised state
- How to know if get_posts() failed?
- Search & Remove Specific Shortcode From All Posts
- Manually delete post from database
- Using $wpdb to query posts with meta value containing current post_id
- Query posts from current year
- WordPress Number of Posts Not Changing With posts_per_page
- I have over 4000 posts, will querying some of them cause performance issues?
- Duplicate posts
- Looping through posts per category gives same posts for each category
- How to show posts rank based on custom field value
- How to force update all posts after import
- How do I create Comma Separated list of attached image ids?
- How to add posts to wp_query result?
- Trying to put an array into ‘post__in’ => array() query not working
- Order post by year DESC and month ASC
- Should ‘setup_postdata()’ be reset with ‘wp_reset_postdata()’?
- How can I display a specific user’s first published post?
- wp_enqueue_media() slows down my WP site
- How can I get all posts data from within a paginated search result?
- Can’t publish new posts
- Search query – exact post title match
- Sorting posts alphabetical that have single digits
- Query posts from different categories in multisite
- Check if post exists
- posts_per_page doesnt work
- Sorting posts according to view counts not working
- Display page content AFTER a loop of posts
- Manually removing revision post types
- Only display posts after current date
- Get posts by multiple ID’s (query)
- How to start with post number x?
- Exclude posts with empty post_content in wp_query
- Reset/Reorder posts ID in the MySQL wp_posts table
- Only display a certain number of posts, dependent on how many posts there are available in a query
- How do I find which articles are missing a featured image in The WordPress database?
- Improving WP_Query for performance when random posts are ordered
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- Tags to Post-ID mysql query. Tag Search
- Query how many items to show in shortcode
- Get posts by name and taxonomy term
- WP_Query Authors OR Categories
- Get Posts that are in the current month or later
- Sticky post appears twice
- do_shortcode within post query
- How Can I Query a Specific Page From a MultiPage paginated Post
- Get Meta Key Value While Saving Post
- Most liked page not displaying posts
- wp_insert_post – duration
- Query get post,how to add comment box
- filter RSS feed in URL
- WordPress custom Query for Posts in Category display posts multiple times
- Get user categories with most posts in it
- MySql query to get posts with all meta and terms
- get query() without post content?
- How can I setup a relationship using categories in WordPress?
- Exclude the first ‘n’ number of posts of a tag from home page?
- Custom order for Mysql array
- posts_per_page option limits the number of Gallery items
- List authors with the last post title and order by last post date
- How i can limit period of post publication?
- How to Mysql select a list of posts with meta_values AND all relevant categories?
- How to setup a query to output posts by groups of five?
- Remove a shortcode from all WordPress posts
- Order posts alphabetically: how to set order=asc in mysql query?
- What do these phpMyAdmin errors mean on my WordPress databaes?
- Exclude current custom post on single post
- What happens if I delete all the rows that represents a post revision from the posts table into WordPress database?
- Dynamically switch template on click
- How to get posts and comments amount per hour, per year and per month?
- Get all custom post types excepted some…
- Get all comments of author’s posts
- First x post with another template then the others
- Why Query is returning empty array?
- Delete all drafts?
- Delete post results in “Cannot delete or update a parent row: a foreign key constraint fails”
- Wrap every month posts in div
- meta_value timestamp older than now
- Counter is skipping post when I still want it visible [closed]
- Do not show children of a category
- post__in not working with pre_get_posts, but post__not_in does work
- Can’t get full post title if there a spaces in title
- How to get all post_parents of a post?
- update image path with words starting uppercase to lowercase chars
- Query for first 3 posts to change the look and feel
- Why posts array is empty?
- Query posts and filter at query time by value of custom meta
- Run query_posts if SESSION is empty?
- Very complex post query
- Delete post revisions only for a single post