Custom Queries In WordPress

Поділитися
Вставка
  • Опубліковано 24 січ 2025

КОМЕНТАРІ • 56

  • @nnivxix
    @nnivxix 2 роки тому

    6:10 WP_Query is good way to filter the post.
    thanks, you save my life.

  • @TubeTester6006
    @TubeTester6006 Рік тому +1

    Newbie here. Thanks to WPCasts for this video. Can I ask some of the experienced WP coders 1) Why is this code happening in a theme in index.html? What if I want to put a custom query on a page in my current site using my current theme? 2) If I am following this tutorial to the letter and coding not on my local computer but on a dev WP website, how can I view the page? What URL should I use?

  • @saidsel-lam2300
    @saidsel-lam2300 3 роки тому

    I discovered you today and feel like christmas came early this year

  • @jlambert12013
    @jlambert12013 3 роки тому

    My mind is blown. This is so much easier than what I have been doing. Thank You.

  • @rabinawale4526
    @rabinawale4526 4 роки тому +3

    my question among this three which is best way to query that is more efficent and that you recommend.... like for fast loading of data

    • @WPCasts
      @WPCasts  4 роки тому +3

      I believe that $wpdb can be the fastest since you have more control over the query and less overhead. But I'm not 100% sure. I'll have to test it out!

    • @SimonDaviesOfCourse
      @SimonDaviesOfCourse 4 роки тому

      @@WPCasts I would agree, by reducing down what your requesting, to what you actually need is faster on the SQL end, so if your making a listing page and just need title, link, image then just asking for those would be better than returning the whole post content. Hope this makes sense, so $wpdb with a bespoke select query would be better. Great video on the ways to do it though as well 👌

  • @nicolaskeith8872
    @nicolaskeith8872 4 роки тому +1

    Alex, these videos are great, thanks for doing them.
    Would really like to see more ways of using custom fields.

    • @WPCasts
      @WPCasts  4 роки тому +1

      More to come!

  • @christopherjschultz
    @christopherjschultz 4 роки тому

    This is very clean and well put together. I love watching your videos. Thanks for the Tutorials!

    • @WPCasts
      @WPCasts  4 роки тому

      Glad you like them!

  • @KurtBunch619
    @KurtBunch619 4 роки тому +2

    Love your tuts as always. Would love to see more on how to build this out with a featured image, excerpt, title, metadata and read more link.

  • @primewholeness
    @primewholeness 3 роки тому

    I was messing around with the Query Loop Block with some CPTUI pages and accompanying taxonomies (cats and tags both)... I finally realized , I think, hat the Query Loop Block will not make use of those custom taxonomies...shrug. I can chose the Custon post type, but not any of the categories or tags that go with that CPT as you see under Posts...(or I still don't have CPTUI settings correct yet) That's how I ended up here on your video...So thanks! I know I can do that if I really must have it..:)

  • @MobiusCoin
    @MobiusCoin 4 роки тому +2

    Hey Alex! Can you show us your CORS configuration sometime?

  • @Allformyequine
    @Allformyequine 4 роки тому +1

    A great resource on queries thank you!!

    • @WPCasts
      @WPCasts  4 роки тому +1

      Glad it was helpful!

  • @TheProDat
    @TheProDat 4 роки тому +3

    Thanks for the tutorials. Please make a video on filtering posts using ACF field's plus AJAX.

  • @toptrendstv
    @toptrendstv 3 роки тому

    Hello, help me on how I can query posts using wp_query, and showing posts by views. I use jetpack views stats and that's what I want to use. I learnt a lot from this video though.

  • @jagansaran5195
    @jagansaran5195 2 роки тому

    Hi
    I need add to cart button click function customization?

  • @green-world-aktar
    @green-world-aktar 4 роки тому

    All of your tuts are really good. Thank you!

    • @WPCasts
      @WPCasts  4 роки тому +1

      Glad you think so!

  • @NagatoKamiPain
    @NagatoKamiPain Рік тому

    how can I handle pagination when using wpdb->get_results ?

  • @ArifBillahOnGoogle
    @ArifBillahOnGoogle 3 роки тому

    You missed mentioning something very important, does the wpdb class use prepared statements?

  • @qber83
    @qber83 3 роки тому

    You made this very easy to follow and extremely helpful. Top notch content as always!!! Would love to see a tutorial on the best way to access post content outside of the loop.

  • @JimKernix
    @JimKernix 4 роки тому

    You only used wp_reset_postdata for get_posts - should you reset the post data after each method?

  • @ozgrymn
    @ozgrymn 4 роки тому

    Thanks for the tutorial, which font do you use in VS code, could you tell please?

  • @obiesilva
    @obiesilva 3 роки тому

    I have a client website where I have a custom post type I created called “Events”. I have a few ACF fields inside of that CPT.
    On the home page I would like to display two of those events at a given time but need to let the user pick which events they need.
    I’m able to do just that, however the ACF fields don’t display everything else does. Is there a way to get the ACF fields to display on any given page from a CPT?

  • @PrzyjacielKamil
    @PrzyjacielKamil 4 роки тому

    Great topic, hope there will be video with more advanced examples.

  • @billwoods4935
    @billwoods4935 4 роки тому

    Very nice tutorial on getting the data FROM the database! Thank you! It'd be super cool to see a complementary tutorial on custom queries TO the database (i.e. insert/update data to the database). Thanks!

  • @lekkyjayz6294
    @lekkyjayz6294 3 роки тому

    Don't you have to reset the post-data after using WP_Query()?

  • @nicolaskeith8872
    @nicolaskeith8872 4 роки тому +4

    Another tutorial idea could be how to setup WP with TailwindCSS 2.0

  • @vitughost6778
    @vitughost6778 4 роки тому +6

    Please make a complete ecommerc project with ACF and CPT(by coding)

  • @SuperRockcore
    @SuperRockcore Рік тому

    Bro, I am trying to get posts to display by page. Like I got an "author's" page (actually teacher's) and I want that page to be theirs, so that only the posts they wrote will display. I've been looking for hours on how to do this simple thing. Is it just like beyond wordpress's capabilities?

  • @kellenmace
    @kellenmace 4 роки тому

    Great overview of ways to query for posts 👍🏼

    • @WPCasts
      @WPCasts  4 роки тому +1

      Thanks, Kellen! Love your work, btw!

    • @kellenmace
      @kellenmace 4 роки тому

      @@WPCasts Thanks! Likewise! 😄

  • @shaneblackwoodGodbless
    @shaneblackwoodGodbless 3 роки тому

    Much love man great content

  • @noise8653
    @noise8653 4 роки тому

    Amazing! Thank you very much!!

  • @JimKernix
    @JimKernix 4 роки тому

    Do you have any videos on how to get custom post types to appear in the main blog roll or other archive pages? I'm a newbie and just built a theme using _s and am working on a CPT that I created using mu-plugins folder and register_post_type. When I click on the tags ot category tied to my CPT the articles from that CPT do not show. SAme with searching, though if I search a keyword in one of the titles, then that will return posts in my CPT. Either I missed something simple or I have to do something with the REST API which I do have show_in_rest set to true in the file where I registered it. If you don't have a video, any websites or articles that cover it?

    • @JimKernix
      @JimKernix 4 роки тому

      Also, I'm not getting what you are getting from the pre tags - I'm getting the content but not the featured images and for WP_Query no SQL stuff or anything near what your output is.

    • @JimKernix
      @JimKernix 4 роки тому

      NEVERMIND - didn't change $posts to $query in the print_r function - total newbie here - still not getting the thumbnail though

    • @JimKernix
      @JimKernix 4 роки тому

      I'm not doing well - for $wpdb I had my CTP output the same posts multiple times but that didn't happen when I chose 'post'...

  • @doni654321
    @doni654321 2 роки тому

    I really need help urgent

  • @TJKhara
    @TJKhara 4 роки тому

    Great video thanks

    • @WPCasts
      @WPCasts  4 роки тому

      No problem 👍

  • @zomalee4512
    @zomalee4512 4 роки тому

    Custom search page tutorial 😀

  • @BucurIonNiculae
    @BucurIonNiculae 4 роки тому

    Nice job.

  • @premnathd
    @premnathd 4 роки тому

    Yes, need rendering tutorial

    • @WPCasts
      @WPCasts  4 роки тому +1

      You got it!

    • @premnathd
      @premnathd 4 роки тому

      @@WPCasts thank you. Many ways are there.. confusing for me. Explain us like this one. This video gives me clarity on custom queries

  • @InHouse-Tech
    @InHouse-Tech 4 роки тому

    Life saver