Skip to content

Instantly share code, notes, and snippets.

@wpmu-authors
wpmu-authors / child_style.css
Created February 4, 2021 09:28
child_style.css
/*
Theme Name: Child Theme for Multisite Network
Theme URI: https://github.com/rachelmccollin/wpmu-dev-list-network-sites
Description: Theme to support WPMU DEV post on adding alist of all sites to each site in the network. Child theme for the WPMUDEV Parent Theme theme.
Author: Rachel McCollin
Author URI: http://rachelmccollin.co.uk/
Template: wpmudev-parent-theme
Version: 1.0
*/
@wpmu-authors
wpmu-authors / wpmu_list_sites1.php
Created February 4, 2021 09:33
wpmu_list_sites1.php
function wpmu_list_sites() {
$subsites = get_sites();
if ( ! empty ( $subsites ) ) {
echo '<ul class="subsites">';
foreach( $subsites as $subsite ) {
@wpmu-authors
wpmu-authors / foreach-inner.php
Created February 4, 2021 09:43
foreach-inner.php
$subsite_id = get_object_vars( $subsite )["blog_id"];
$subsite_name = get_blog_details( $subsite_id )->blogname;
$subsite_link = get_blog_details( $subsite_id )->siteurl;
echo '<li class="site-' . $subsite_id . '"><a href="' . $subsite_link . '">' . $subsite_name . '</a></li>';
@wpmu-authors
wpmu-authors / wpmu_list_sites2.php
Created February 4, 2021 09:45
wpmu_list_sites2.php
function wpmu_list_sites() {
$subsites = get_sites();
if ( ! empty ( $subsites ) ) {
echo '<ul class="subsites">';
foreach( $subsites as $subsite ) {
@wpmu-authors
wpmu-authors / style1.css
Created February 4, 2021 09:47
style1.css
/* list of network sites */
ul.subsites {
list-style-type: none;
background: #3394bf;
overflow: auto;
}
ul.subsites a {
float: left;
margin: 0.5em;
color: #fff;
@wpmu-authors
wpmu-authors / wpmu_list_sites3.php
Created February 4, 2021 09:51
wpmu_list_sites3.php
function wpmu_list_sites() {
$subsites = get_sites();
if ( ! empty ( $subsites ) ) {
echo '<section class="subsites-container">';
echo '<ul class="subsites">';
@wpmu-authors
wpmu-authors / style-container.css
Created February 4, 2021 09:55
style-container.css
.subsites-container {
background: #3394bf;
}
ul.subsites {
list-style-type: none;
overflow: auto;
max-width: 1000px;
margin: 0 auto;
}
@wpmu-authors
wpmu-authors / style-links.css
Created February 4, 2021 10:10
style-links.css
@wpmu-authors
wpmu-authors / style_ul.css
Created February 5, 2021 08:55
style_ul.css
ul.subsites {
list-style-type: none;
overflow: auto;
max-width: 1000px;
margin: 0 auto;
}
@wpmu-authors
wpmu-authors / functions.php
Created February 5, 2021 12:39
functions.php
include( get_stylesheet_directory() . '/includes/customizer.php' );