Responsive WordPress Theme – Caliber

A theme with simple controls and limitless potential. Work fast and build an amazing website!   Find out more »

UpThemes – Beautiful WordPress Themes

Create a site your church, gallery, newspaper, blog, recipes, band and more!   See the themes »

Need a little help?  Find answers quickly by searching the forum.
Group Admins
  • andy
  • jeffw
  • admin

Support for: Moxie – Responsive Theme for WordPress

Moxie

Public Group  |  active 1 week, 1 day ago ago
Viewing post 1 to 15 (22 total posts)

Blog and portfolio shortcodes don’t work as expected

  • vunguyen

    said

    Blog and Portfolio shortcodes doesn’t work as expected:
    Example:
    - Blog shortcode: I have 3 post categories with ID: 1, 2, 3
    According to Moxie’s docs: I created 1 page with this short code: [blog template="blog-image-top" paging="true" category_in="(2,3)"]
    - Portfolio shortcode: I have 6 portfolio categories with ID: 4, 5, 6, 7, 8, 9
    According to Moxie’s docs: I create 1 page with this short code: [portfolio template="portfolio-static" columns="5" posts_per_page="100" category_in="(5,6)"]

    The shortcodes didn’t work as expected. They call ALL the categories of their type. Example:
    - Blog shortcode call all 1, 2, 3 categories.
    - Portfolio shortcode call all 4,5,6,7,8,9 portfolio categories.

    Extra notes:
    - It doesn’t work even on a brand new installation.
    - It will work if you are trying to call ONE (1) category only. Example of the parameter: cat="(5)"
    - If you are trying to call an array (multiple categories), it will call all the categories you have of that post type.
    (I’m using category_in parameter according to the link in Moxie’s documentation: https://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters))

    Thanks guys!

  • andy

    said

    I think it’s because of the way the array is being calculated by the shortcode. Please try a parameter that uses a string and not an array and that should work. Right now that only test I see being done is using array parameters.

    For the array parameters, try adding an extra “0″ to the start. For example, category__in="(0,2,3)

    You’re not using the correct parameter. It might be wrong in the documentation, but there are two underscores __ between “category” and “in” so it should be category__in not category_in

  • andy

    said

    One more note based on the details of your “Extra notes” that I want to point out. The cat parameter takes an integer, not an array. If using that you should be entering it as cat="5" not cat="(5)"

    It’s important to check the value specified in the WP_Query documentation because it influences the way it’s written in the shortcode.

  • jeffw

    said

    @andy

    Comma separated strings are breaking as well. I sent you an email. e.g. cat="1,2,3" barfs a PHP warning and lists all posts. Ditto with category_name="home,design". Should work, but it doesn’t, it barfs a PHP warning and lists all posts.

  • jeffw

    said

    I can confirm that the zero is needed for array parameters.

       category__in="(2,10)" lists only posts in category ID 10.

       category__in="(0,2,10)" lists posts in category IDs 2 and 10.

  • vunguyen

    said

    Hi guys,

    I can’t seem to use category__in at all?!?
    If I try to use double underscores. The page comes up blank :/
    Same on both xampp and live server.
    Example:
    [portfolio template="portfolio-filtered" columns="5" posts_per_page="10" category__in="(0,61,62,63)"] with or without 0
    The page with that shortcode is showing blank on both xampp and live (I triple checked the portfolio category IDS – they are valid)
    Same goes for static template.

    category_name="example"
    1 underscore according to the doco. It will also display a blank page.

    Ideas? :/

    Thanks guys!

  • jeffw

    said

    Sorry, I should have said that I was testing the [blog] shortcode.

    You should have started two new topics because the issue is actually two separate issues. :D It’s amazing how quickly a topic can get confusing if you try to discuss two separate issues in it.

    @andy

    I can now confirm the behaviour vsync is describing with the [portfolio] shortcode – with both the category__in and category_name parameters. i.e. Zero output.

  • jeffw

    said

    The post__in array parameter is working with the [portfolio] shortcode.

  • andy

    said

    Portfolio’s are custom post types and although the name of the taxonomy is “category” I don’t think it accepts the WP default category parameters, category__in and category_name. You can use post parameters, or even a custom taxonomy parameter like category by specifying category="name" (not tested).

    See the documentation here: https://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters

  • vunguyen

    said

    Hi andy and jeffw,

    post__in is sort of hard to use if you are going to have a few hundred portfolio and posts.
    category="name" does not work at all :’(

    I will patiently wait for the fix. Thanks guys!
    If this doesn’t work, the whole section of the website needs to be “readjust” … somehow … :(

  • jeffw

    said

    Doh! Of course! So post_type="portfolio" should work for a start. So should taxonomy="portfolio-category". And then terms="name1,name2,name3" for the so-called portfolio categories. (I think.)

    Not tested any of this and I have to dash now so it’ll have to wait until tomorrow.

    @vunguyen Play with the taxonomy parameters, that’s the key.

    Thank you, @Andy, I should have twigged this hours ago but I’ve been multitasking today. ;)

  • vunguyen

    said

    Hi jeffw and andy,

    Please help me out. I’m way out of my depth here. I tried to play with what you guys suggested without any luck.
    Could you please give me a full example that works? :/

    Thanks guys!

  • jeffw

    said

    Hi, vsync.

    I am not hiding or holding back anything from you, if I had a full example that works do you not think I would have posted it a long time ago? This array stuff is all new to me too, earlier Parallelus themes didn’t support array parameters. The portfolio custom post type is also new, no other Parallelus theme has a portfolio custom post type. I am learning about this theme just as you are. When I can find some time to play and experiment with all this new stuff I promise ! will share what I learn with you. But if you need answers yesterday then the best advice I can give you is to hire a professional developer who can provide that instant service for you.

  • vunguyen

    said

    Hi jeffw,

    I apologise if I offended you. I didn’t mean it. :(
    I was just saying that when you have an example that works, please let me know.

    Thanks jeffw.

  • andy

    said

    @vunguyen

    Jeff is working right now on putting together a tutorial for these features. He sent me a long email with details of his tests and specific questions to ensure he is using the most accurate information for the tutorial.

    I’ve identified a few bugs in the shortcodes and as I’m fixing those I’ll be supplying Jeff with the needed details for his tutorials. In a few days we should have some nice Moxie resources for these features that you can use for your website going forward.

    With Moxie being so new, in terms of the change in framework and updated Portfolio methods, this is something we’ll need to get caught up on to ensure customers have the resources they need to build their website. It’s a priority for us and we will make sure those resources are developed.

    Thanks.

Viewing post 1 to 15 (22 total posts)
Topic tags: array, blog, call, Category, portfolio, shortcode