Skip to content

Instantly share code, notes, and snippets.

@msenateatplos
Created August 23, 2013 00:31
Show Gist options
  • Save msenateatplos/6314332 to your computer and use it in GitHub Desktop.
Save msenateatplos/6314332 to your computer and use it in GitHub Desktop.
Script to display all post links for all blogs on a WordPress multi-site installation. Place in `wp-content/` then browse to http://yourblogdomain.com/wp-content/all-urls-all-sites.php or use as a script. Use `&post_type=article`, `&post_status=publish` and various other options with `query_posts()`
<?php
require_once('../wp-blog-header.php');
$blog_list = get_blog_list( 0, 'all' );
foreach ($blog_list AS $blog) {
switch_to_blog($blog['blog_id']);
query_posts('&showposts=-1&order=ASC');
while (have_posts()) : the_post(); ?>
<?php the_permalink(); ?>
<br />
<?php endwhile; ?>
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment