Multi-Site Site List Shortcode
request: return (not echo) the output (2 posts)

  1. RavanH
    Posted 5 years ago #


    To prevent the output (list of sites) showing before (above) the post content where the shortcode is placed, use return instead of echoing the list from within the shortcode function.

    The end of the main function would then look like this (with class added to allow custom styling) :

    		$echo = "<ul class=\"site-list\">";
    		while (list($key, $value) = each($siteList)) {
         			$echo .= "<li><a target=\"_blank\" href=\"http://" . $value . "\">" . $key . "</a></li>";
    		$echo .= "</ul>";
    		return $echo;
    	} else {
    		return "";
  2. Chris Wiegman
    Plugin Contributor

    Posted 5 years ago #

    Ryan, thanks for the heads up. Without any other content on my test pages I completely missed that.

    I'll get the custom style item in the options soon, but it will be implemented in such a way as to allow input from the options page while still allowing the style code to be minimized using W3 Total Cache or something similar. As soon as I am a little less short on time I will implement this.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Multi-Site Site List Shortcode
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic