It works, sort of. I am always adding and removing sites with turnover. I used a much higher number than I need right now, just so I don’t have to think about it in the future.
I’ve also noticed that if the tagline is missing, it’ll push the <li>
sort of under the previous li, so it looks like a nested list, but semantically it isn’t. (I fixed this with a little inline js(jQuery)).
It also shows three non-existent sites if the number=”” is greater than the number of sites.
Have you considered using the count() method to return the number of sites to use? Would it be possible to listen for the registering or deregistering of new or existing sites to update the number so it isn’t fired every time the shortcode is served?
Just spitballing here. I don’t use PHP enough to be able to write it. I know enough JS to fix the output, but not enough to prevent the server errors, which were something I was hoping to solve with your plugin (which, btw, is an improvement already, so thank you!)
WordPress database error
Table 'wp_bmadmin.wp_258_options' doesn't exist
for query SELECT option_value FROM wp_258_options
WHERE option_name = 'wp_258_user_roles' LIMIT 1
/* From [benchmark.us/network-sites/] in [/nas/content/live/bmadmin/wp-content/plugins/multisite-site-index/multisite-site-index.php:170] */
made by require('wp-blog-header.php'),
require_once('wp-includes/template-loader.php'), include('/themes/make/template-builder.php'),
get_template_part,
locate_template,
load_template,
require('/themes/make/partials/content-page-builder.php'),
get_template_part,
locate_template,
load_template,
require('/themes/make/partials/entry-content.php'),
the_content,
apply_filters('the_content'),
WP_Hook->apply_filters,
call_user_func_array,
do_shortcode,
preg_replace_callback,
do_shortcode_tag,
call_user_func,
multisite_site_index_do_shortcode,
multisite_site_index_get_markup,
switch_to_blog,
WP_Roles->__construct,
WP_Roles->_init,
get_option
-
This reply was modified 7 years, 11 months ago by
Jasonian.