Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • I’m trying to use this plugin with WP 3.0 Multisite, but for some reason, the target by url approach isn’t working at all. This is my setup:

    1. I have two blogs:
    https://www.mydomain.com/en/
    https://www.mydomain.com/fr/

    2. I’m attempting to show a widget *only* on a page as such:
    https://www.mydomain.com/en/some-page-name/
    – using the following rule in WidgetContext:
    – some-page-name
    – some-page-name/*
    – No such luck.

    3. I have even tried with the following rules:
    – en/some-page-name
    – en/some-page-name/*
    – fr/some-page-name
    – fr/some-page-name/*

    Is this plugin compatible with WP Multisite? I have had great success with it on standalone installations of WP, but this is the first time I’ve tried using it with MultiSite. Any suggestions would be most welcome.

    In WP 3.0.x I’ve had to register a taxonomy for the pages (which don’t natively use categories, unlike posts). Here’s the snippet to enable the categories box to show:
    register_taxonomy_for_object_type(‘category’,’page’);

    Wow. It’s a lot simpler than that to count WordPress’ search results, here:

    <?php
        global $wp_query;
        $count = sizeof( $wp_query->posts );
        echo"<pre>";
        //var_dump($wp_query);// The WP Query Object
        var_dump($wp_query->posts); // The WP Query Object's 'posts' property (note the plural)
        echo"</pre>";
    ?>

    If you drop that snippet in your search template, it will output the properties of the ‘$wp_query’ variable, specifically the ‘posts’ property of the object. This is an array that stores a collection of the returned posts from the search query, which you can do a number of things with once you access it, including (*drumroll*), *count* the number of posts in that array using either PHP’s ‘count()’ or ‘sizeof()’ function.

Viewing 3 replies - 1 through 3 (of 3 total)