• Resolved Eirik Vorland

    (@kjelldasensei)


    I am trying to get my two most recently added products to display in a box on my front page.

    I have tried using the following shortcodes:

    [products limit=”2″ columns=”2″ orderby=”id” order=”DESC”]
    [products limit=”2″ columns=”2″ orderby=”date” order=”DESC”]

    In both cases I’ve tried changing the order to “ASC”, but no matter which code and order I use it displays the first two products I added to my store, not the two newest products.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello @kjelldasensei!

    I checked the shortcodes you used and found you are adding inverted comma(“) in 2 different ways which must be causing the issue.

    Please try adding the following shortcodes and see if it works.

    
    [products limit="2" columns="2" orderby="id" order="DESC"]
    [products limit="2" columns="2" orderby="date" order="DESC"]
    

    ——————————————————————–

    You may know more about available WooCommerce shortcodes on this page. → https://woocommerce.com/document/woocommerce-shortcodes

    Hope it helps.

    Thread Starter Eirik Vorland

    (@kjelldasensei)

    Hi, Mashi

    The inverted commas just happened when pasting the code into this forum. In the code on my page, the proper quotation marks are used.

    I tried copy+pasting your shortcodes, but they have no effect. It still only displays my two oldest products, even if I switch between ASC or DESC order.

    Regards,
    Eirik

    Plugin Support Daniyal Ahmed (a11n)

    (@daniyalahmedk)

    Hi there,

    This kind of problem is usually caused by a conflict with your theme or with another plugin.
    ?
    The best way to determine this is to:

    • Temporarily switch your theme to Storefront
    • Disable all plugins except for WooCommerce
    • Repeat the action that is causing the problem

    If you’re not seeing the same problem after completing the conflict test, then you know the problem was with the plugins and/or theme you deactivated. To figure out which plugin is causing the problem, reactivate your other plugins one by one, testing after each, until you find the one causing conflict. You can find a more detailed explanation on how to do a conflict test here.

    Best,

    Thread Starter Eirik Vorland

    (@kjelldasensei)

    Hi, Daniyal

    Switching the theme corrected the error. Now I just have to troubleshoot what in my theme that messes this code up.

    Thanks!

    Regards,
    Eirik

    Plugin Support Daniyal Ahmed (a11n)

    (@daniyalahmedk)

    Hi there,

    I am glad this has been sorted out. I’ll go ahead and mark this thread as solved now. If you have any questions, please open a new support request at

    https://www.ads-software.com/support/plugin/woocommerce/

    Have a wonderful day.

    Best,

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Recent products shortcode not working’ is closed to new replies.