Custom Queries In WordPress

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ธ.ค. 2024

ความคิดเห็น • 56

  • @saidsel-lam2300
    @saidsel-lam2300 2 ปีที่แล้ว

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

  • @nnivxix
    @nnivxix 2 ปีที่แล้ว

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

  • @jlambert12013
    @jlambert12013 3 ปีที่แล้ว

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

  • @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!

  • @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?

  • @TheProDat
    @TheProDat 4 ปีที่แล้ว +3

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

    • @WPCasts
      @WPCasts  4 ปีที่แล้ว +1

      Noted!

  • @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.

  • @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!

  • @MobiusCoin
    @MobiusCoin 4 ปีที่แล้ว +2

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

  • @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 👌

  • @Allformyequine
    @Allformyequine 4 ปีที่แล้ว +1

    A great resource on queries thank you!!

    • @WPCasts
      @WPCasts  4 ปีที่แล้ว +1

      Glad it was helpful!

  • @aktaruzzaman849
    @aktaruzzaman849 4 ปีที่แล้ว

    All of your tuts are really good. Thank you!

    • @WPCasts
      @WPCasts  4 ปีที่แล้ว +1

      Glad you think so!

  • @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.

  • @nicolaskeith8872
    @nicolaskeith8872 4 ปีที่แล้ว +4

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

  • @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!

  • @PrzyjacielKamil
    @PrzyjacielKamil 4 ปีที่แล้ว

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

  • @primewholeness
    @primewholeness 2 ปีที่แล้ว

    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..:)

  • @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! 😄

  • @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.

  • @ozgrymn
    @ozgrymn 4 ปีที่แล้ว

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

  • @ArifBillahOnGoogle
    @ArifBillahOnGoogle 3 ปีที่แล้ว

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

  • @obiesilva
    @obiesilva 2 ปีที่แล้ว

    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?

  • @vitughost6778
    @vitughost6778 4 ปีที่แล้ว +6

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

  • @JimKernix
    @JimKernix 4 ปีที่แล้ว

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

  • @NagatoKamiPain
    @NagatoKamiPain ปีที่แล้ว

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

  • @jagansaran5195
    @jagansaran5195 2 ปีที่แล้ว

    Hi
    I need add to cart button click function customization?

  • @shaneblackwoodGodbless
    @shaneblackwoodGodbless 3 ปีที่แล้ว

    Much love man great content

  • @lekkyjayz6294
    @lekkyjayz6294 3 ปีที่แล้ว

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

  • @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?

  • @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'...

  • @TJKhara
    @TJKhara 4 ปีที่แล้ว

    Great video thanks

    • @WPCasts
      @WPCasts  4 ปีที่แล้ว

      No problem 👍

  • @BucurIonNiculae
    @BucurIonNiculae 4 ปีที่แล้ว

    Nice job.

    • @WPCasts
      @WPCasts  4 ปีที่แล้ว

      Thanks!

  • @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

  • @zomalee4512
    @zomalee4512 4 ปีที่แล้ว

    Custom search page tutorial 😀

  • @doni654321
    @doni654321 ปีที่แล้ว

    I really need help urgent

  • @InHouse-Tech
    @InHouse-Tech 4 ปีที่แล้ว

    Life saver