This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Using query parameter in [post_grid] shortcode

  • Creator
    Topic
  • #3138
    falfaro
    Participant

    I think my problem relates to this. I am trying to use a shortcode with the query parameter but I am getting a “Notice: Array to string conversion in /…/builder.php on line 650.”

    How do you pass the parametes in a shortcode?

    i.e.

    [post_grid columns="3" rows="3" query="tag=comedy" orderby="post_date" order="DESC" offset="0"]

    query=”tag= does not look right.

    Thank you

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #3157
    Jason Bobich
    Keymaster

    This should be correct. What version of the theme are you using? Are there any posts currently with a “comedy” tag? Is this the exact usage you’re using in your site?

    #3161
    falfaro
    Participant

    Hi Jason. I am using Version: 1.1.5.

    the comedy tag is just an example. Post Grip Widget with the following query worked

    post_type=products&posts_per_page=8&cat=19

    Using the same in a shortcode does not work

    query="post_type=products&posts_per_page=8&cat=19"
    • This reply was modified 7 years, 8 months ago by falfaro.
    • This reply was modified 7 years, 8 months ago by falfaro.
    • This reply was modified 7 years, 8 months ago by Jason Bobich.
    #3168
    Jason Bobich
    Keymaster

    What’s odd is that the line corresponding to your notice can’t happen if there’s a custom query happening. So, something is off here.

    I’m not sure if my forum is messing with what you’re putting in or not.

    (1) Are you doing this:

    query="post_type=products&posts_per_page=8&cat=19"

    (2) Or are you doing this:

    query="post_type=products&posts_per_page=8&cat=19"
    #3990
    falfaro
    Participant

    I am using the latter (2). A better example will be:
    This query works fine in a widget:

    post_type=solutions&category_name=solution-service-provider&numberposts=3&offset=0&orderby=rand&order=DESC

    but it does not in a shortcode

    [post_grid columns="3" rows="3" query="post_type=solutions&category_name=solution-service-provider&numberposts=3&offset=0&orderby=rand&order=DESC" link="false" link_target="_self"]

    I repeater, I am not using the HTML code for ampersand (& amp ; )

    Thank you

    • This reply was modified 7 years, 7 months ago by falfaro.
    • This reply was modified 7 years, 7 months ago by falfaro.
    • This reply was modified 7 years, 7 months ago by falfaro.
    • This reply was modified 7 years, 7 months ago by falfaro.
    • This reply was modified 7 years, 7 months ago by Jason Bobich.
    #3995
    falfaro
    Participant

    It looks like my custom post type was messing with the categories in some strange way. After I restored the swagger theme the shortcode worked. Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The forum ‘Swagger Responsive WordPress Theme’ is closed to new topics and replies.