rtourtelot
Forum Replies Created
-
Ah, that worked great! Thanks so much, Matt!
Forum: Developing with WordPress
In reply to: Querying Custom Posts Using an ArrayThanks so much, Karan. The IN operator doesn’t do the trick, unfortunately.
Basically, the for loop is populating the $meta_array with colors to compare each post in the loop’s colors array against. I believe it may be unserializing the $similar array, as from what I’ve read, serialized arrays are being used over multiple meta entries for the ACF checkbox.
In any case, does that preclude me from being able to use IN?
Thanks again!
Forum: Developing with WordPress
In reply to: Querying Custom Posts Using an ArrayThanks so much!
I have it working–almost. The only issue is, this is currently only returning posts that have ALL of the colors matching, rather than simply returning posts that match any of the colors in the “colors” array for the current post (i.e. “red” OR “blue”).
I should mention that “colors” is an ACF checkbox, if that makes a difference. I think the data might be serialized, but I’m not 100% what that means.
In any case, here’s the code:
$current = get_the_ID(); $similar = get_field('colors'); wp_reset_postdata(); // build meta_queries based on similar for ($i=0; $i < count($similar); $i++) { $meta_array[] = array( 'key' => 'colors', 'value' => $similar[$i], 'compare' => 'LIKE' ); } // do the query $more_like_this = new WP_Query(array( 'posts_per_page' => 6, 'relation' => 'OR', 'meta_query' => $meta_array )); ?> while ($more_like_this->have_posts()) : $more_like_this->the_post(); the_title(); echo '<br/>'; endwhile; wp_reset_query(); ?>
It’s so close–just not sure what I’m missing. Thanks in advance for any help!
- This reply was modified 7 years, 10 months ago by rtourtelot. Reason: clarification
Forum: Plugins
In reply to: [Comments - wpDiscuz] Participate via email phraseForum: Plugins
In reply to: [Comments - wpDiscuz] Participate via email phraseWhere to edit it, that is.
Forum: Fixing WordPress
In reply to: Loop only showing most recent postI see—I’m supposed to change showposts=1 to showposts=4!
Forum: Localhost Installs
In reply to: Local WP install, image uploading issue: can't find ajax.phpOkay, I think I’ve figured it out. Basically, when I was launching/viewing the site from CodeKit, it was resolving the URL without localhost and the port. So instead of:
https://localhost:8888/wordpress
It was launching as just:
wordpress
This was working fine for viewing, but for some reason totally messed up the media uploader. Everything else seemed to work fine. Odd, but there it is!
Forum: Localhost Installs
In reply to: Local WP install, image uploading issue: can't find ajax.phpThanks, Brad–I’ll definitely let you know if I get an answer.
To clarify in my case, it’s not so much the theme images, but that I can’t get images to upload with the media uploader. It’s definitely something exclusive to the local install, as when I copied the exact same file up to a server, it worked fine. I’ve tried addressing the permissions, I’ve tried a clean install… but the 404 thing seems really bizarre to me.
Does anyone know a consultant I might be able to hire to figure this out? I’m unable to work with WP locally in the meantime, which is obviously a pretty big drag.
Thanks!
Forum: Localhost Installs
In reply to: Local WP install, image uploading issue: can't find ajax.phpI moved the same exact site files now to a server, and everything works just fine. There’s obviously something wrong with the set-up or something that makes the local WP install unable to upload images. Does anyone have any suggestions of anything else I might try?
It’d have to be something with MAMP Pro, or…?
Forum: Localhost Installs
In reply to: Local WP install, image uploading issue: can't find ajax.phpAnyone have any ideas? I’m kinda desperate for a solution here… thanks!
Forum: Localhost Installs
In reply to: Local WP install, image uploading issue: can't find ajax.phpHere’s what I’m seeing in the console, if that helps:
Forum: Localhost Installs
In reply to: Local WP install, image uploading issue: can't find ajax.phpConfirmed with a fresh install of 4.1. I’m seeing this:
The console is showing a 404 for admin-ajax.php, though that file is there, and I can click on the link in console and pull it up, no problem.
It’s also showing a 404 for async-upload.php. I see that file in the directory, but when I click on the link in console, it says “The requested URL /aytozee/aytozee/wp-admin/async-upload.php was not found on this server.” The weird thing is that it’s using the exact same link/directory structure as admin-ajax.php.
Any ideas? I’m really stuck without being able to upload images. Thanks!
Forum: Fixing WordPress
In reply to: Trouble pulling custom post values in loopHere’s the answer for anyone else who’s wondering: in the above,
the_title()
needs to be replaced withget_the_title()
. That’s it. Works great now.Forum: Fixing WordPress
In reply to: Trouble pulling custom post values in loopThanks.
Forum: Fixing WordPress
In reply to: Trouble pulling custom post values in loopIs this in the wrong forum section, maybe? I couldn’t seem to post it in Advanced.