Timeline for Show specific posts with WP_Query using ACF Post object
Current License: CC BY-SA 4.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 3, 2018 at 15:55 | comment | added | Sally CJ |
Sorry for the late reply @Stefan. I don't actually really understand this: "$post_object don't have value in array about post_format", but get_post_format( $post_object->ID ) should return the proper post format, if post formats are supported by the active theme. But anyway, what I was going to say are already in honk31's (good) answer, so all the best. =)
|
|
Aug 30, 2018 at 19:18 | comment | added | Stefan | @SallyCJ Correct, if you can, it would help me a lot ;-) BTW, i search google as well, don't think i just want from someone to help me and share his/hers knowledge with me because i'm too lazy. Also i found answer about this one from 2014, and still no change link | |
Aug 30, 2018 at 19:10 | comment | added | Sally CJ | @Stefan If I can, I would see if I can do something that might help you with that. :) | |
Aug 30, 2018 at 19:02 | comment | added | Sally CJ | Mind your language @honk31. See meta.stackexchange.com/conduct | |
Aug 30, 2018 at 19:01 | comment | added | Stefan | @JacobPeattie Check my replays | |
Aug 30, 2018 at 19:00 | comment | added | Stefan | @honk31 Thank you for your words. Everything is true what you said, but the OBJECT doesn't contain post_format, that i really need for calling that specific template | |
Aug 30, 2018 at 18:56 | comment | added | Stefan | @SallyCJ I do like this because $post_object don't have value in array about post_format. Also get_post_format() didn't work even if i pass ID of specific post. So i need to do this like this. If you know how to do this i will be more then grateful! | |
Aug 30, 2018 at 10:50 | comment | added | Sally CJ |
I was actually going to ask the same question @JacobPeattie. Stefan, you could really just loop through the $post_objects you have and display the post anyway you like. There's the setup_postdata() function if you need to call the_content() or similar 'the_xxx'/'get_the_xxx' functions for the current post.
|
|
Aug 30, 2018 at 10:43 | comment | added | Jacob Peattie |
This code doesn't make any sense. Why are you performing another query for posts that you already have? The posts you have are already in $post_objects , you don't need to do another WP_Query .
|
|
Aug 30, 2018 at 10:35 | comment | added | Sally CJ |
Or instead of setting $string as a string variable, you can just make it an array . That way, you don't need to do the explode() -ing. :) See this (find all the $string on that page). And btw, in your code, you forgot to change the array( $string ) to $arr .
|
|
Aug 30, 2018 at 10:26 | history | answered | Stefan | CC BY-SA 4.0 |