WordPress.org

Support

Support » Multisite » wp_list_pages getting wrong site

wp_list_pages getting wrong site

  • Posting here as the multisite element of my problem seems the most relevant. I’m using CKEditor with the MTC CKEditor Link Page plug-in. (I could query the plugin creators but it’s simple enough I can hack it myself if I can figure out what’s going on.) It’s supposed to easily allow you to grab a link to an existing Page on your site.

    It does this by creating a page using wp_list_pages(), then some short javascript to return the page URL when you click.

    The problem? The page generated by wp_list_pages() always seems to list the pages of the “main” site I created first, and not the site I’m currently logged in to and editing.

    Here’s the key bits of the plugin:

    window.onload = function() {
    			var atags = document.getElementsByTagName("a");
    			for(var x in atags) {
    				atags[x].onclick = addLink;
    			}
    		}
    	</script>
    </head>
    <body>
    <?php wp_list_pages(); ?>
    </body>

    Why would wp_list_pages() not return the pages of the site I’m actually working on? I’m stumped.

    FWIW, my site is http://www.rivendell-school.org/physed

    The “main site” is the root, http://www.rivendell-school.org/index.php (you need the .php because it’s sitting on top of the existing site and the index.html gets served up first).

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘wp_list_pages getting wrong site’ is closed to new replies.
Skip to toolbar