0

I have created a custom post for slider of my theme using owl carousel.As by default, it always shows latest post first in the slider.If I want to show some specific post,what can I do.

Although the posts are in the loop, but is it possible to show,(say no 2, 4, 1, 3 in this order) some specific post rather than latest post?

I am using the slider as shortcode in a custom plugin.

Here is my code ( https://gist.github.com/rashed-amin/47e856dc0823fbcaf5f8338db01e9365)

Thanks

  • We can't answer without knowing how you are implementing your CPT with Owl carousel. Please edit your question and add some code, so that we can assist you, the way you are. – Mayeenul Islam Jan 20 '18 at 5:39
  • You can use this plugin: wordpress.org/plugins/post-types-order then in query add this to get the current menu order Include: ‘orderby’ => ‘menu_order’ – mysticalghoul Jan 20 '18 at 5:42
  • You can display random post by setting orderby attribute to rand in $args – melvin Jan 20 '18 at 7:05
  • 1
    Hi, Thanks, although I want a custom function, but the plugin is now solved the issue. – Rameen Jan 20 '18 at 14:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.