Mashup of multiple categories fails

Home Forums MapPress Support Mashup of multiple categories fails

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #10182
    mapbeat
    Participant

      Since 2.38.2

      Mashups of multiple categories fail to an empty map

      query=”category_name=1,2,3″ no longer works

      query=”category__in=1,2,3″ doesn’t work
      How do we write queries for multiple category mashups?

      Thanks,
      Keith

      #10186
      Chris
      Keymaster

        Hi,

        It may be a bug.  Please upgrade to the latest (2.38.5).

        I just tested that version with category__in and it worked fine for me.  I’m assuming you’re using slugs for category_name and IDs for category__in.

        Here’s how I wrote my mashup:

        [mashup query="category__in=1543,1531"]

         

        #10194
        mapbeat
        Participant

          The problem is in 2.38.5. From your reply I’m guessing that

          category_name=1,2,3 is for category names and

          category_in=1,2,3 is for category IDs.

          If that is correct, the problem occurs with category_name.

          #10195
          Chris
          Keymaster

            Hi,

            Category_name is for category slugs, which are not always the same as the description.  Are you using slugs?

            If so, can you provide an example of your complete mashup shortcode?

            #10197
            Chris
            Keymaster

              Hi,

              I think I see the problem: if you read the WordPress documentation carefully it mentions that category_name only takes a single slug as a parameter, not an array (list) of terms:

              Here’s an excerpt from http://codex.wordpress.org/Class_Reference/WP_Query

              • category_name (string) – use category slug (NOT name).
              • category__and (array) – use category id.
              • category__in (array) – use category id.
              • category__not_in (array) – use category id.

              There are a few examples in the mappress documentation.

            Viewing 5 posts - 1 through 5 (of 5 total)
            • You must be logged in to reply to this topic.