Support » Plugin: Multisite Directory » Shortcode filter sites in a specific category

  • Resolved edemir206

    (@edemir206)


    Hi,

    The filter [site-directory display=”list” query_args='{“category”: “templates”}’ ] or [site-directory display=”list” query_args='{“cat”: “templates”}’ ] simply does not work, the shortcode show’s all subsites always.

    Do I need to configure something else than create a category and assign subsites to it ?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Meitar

    (@meitar)

    cat is the query parameter for the WordPress default “post category” taxonomy. This is not the taxonomy used to categorize sites, but posts. You need to use a tax_query. This is described on the plugin’s readme file. See also the WordPress documentation for a custom taxonomy query.

    Ok, so let me see if I understand

    I need to register a custom taxonomy using subsite_category ?

    Sorry for not understand, I really thought I could just use the builtin categories your plugin provide out of the box.

    Plugin Author Meitar

    (@meitar)

    I need to register a custom taxonomy using subsite_category ?

    No. As described in the plugin readme, subsite_category is the custom taxonomy registered by this plugin to categorize subsites.

    Once categorized, use the query_args attribute of the shortcode to interface with the WP Query object that the plugin uses to retrieve the sites. All the options documented in the WP_Query object reference (linked above) are supported by this plugin; you pass them to the plugin as a JSON object. For example:

    [site-directory display="list" query_args='{"slug":"foo,bar"}']
    

    More details on the issue tracker.

    Ok now I’m getting somewhere 😀

    One more thing, I have some sites I already created, how do I edit their categories ? I know that when I go to my network > new site there’s a category option, but in the edit of sites there’s no such option. Sorry for being noob.

    Plugin Author Meitar

    (@meitar)

    Edit the directory entry Page’s category
    That is what is being categorized in the first place, not the site itself.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Shortcode filter sites in a specific category’ is closed to new replies.