jomccartin
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Custom Fields Search] [Plugin: WP Custom Fields Search] Checkboxes?Bump! Any news on this front? Any help is greatly appreciated!!
Forum: Themes and Templates
In reply to: Custom query filtered by meta_value that is an array?Hi Chip-
I’ve tried this and it hasn’t worked, but I think I know why now. I’ve discovered the value of ‘my_key’ is actually a multidimensional array for some reason. (If you look in the second code block I posted, I run a foreach and then an in_array to drill down into these arrays.) The custom fields themselves were produced by the Advanced Custom Fields plugin. Perhaps this has something to do with it.
After some research, the author of that plugin has actually concluded what I wanted to do is impossible: http://support.plugins.elliotcondon.com/discussion/499/how-to-query-through-multiple-select-meta_values/p1
I’m not entirely sure it’s impossible, but I don’t know quite enough to offer a full-on solution.
Forum: Themes and Templates
In reply to: Custom query filtered by meta_value that is an array?Hey, thanks for the input! That didn’t do it, but it did give me the push to figure out a partial solution. It’s not really what I wanted to do, and if this group ends up having a lot of posts, it’s going to get very slow & clunky. Instead of filtering by value, I filter only by key, and then display only posts with the correct value using an IF statement.
<?php $args = array ( ... 'meta _query' => array ( array ( 'key' => 'my_key' ) ) ) $new_query = new WP_Query( $args ); ...//start loop... $values = get_post_meta($post->ID, 'my_key', false); $foreach ($values as $val_sub) : if ( in_array('target_value', 'my_key') ) : ?> <div class="post">...</div> <?php endif; endforeach; ?>So yea, it’s not ideal in any way and doesn’t really solve the problem. But it’s going to display the right posts the very least.
This seems to be a lingering issue. There’s been a few posts on dealing with arrays as meta_values, and the Codex itself requests a solution in the orderby meta_value section. I’m not going to mark this resolved since the central issue isn’t closed, but I did want to share my workaround.
Forum: Themes and Templates
In reply to: Custom loop using a meta_value that is an arrayHey, I’m having the same problem, but I just walked into the project close to its finish. I can’t really change their data structure at this point. Here’s the code:
$args = array( 'numberposts' => -1, 'post_type' => 'post', 'meta_query' => array ( array ( 'key' => 'my_key', 'value' => 'target_value', ) ) ); $new_query = new WP_Query( $args );The key ‘my_key’ always has an array as its value, so of course it will never match the queried ‘target_value’. How do I find the ‘target_value’ in the array? This is an array of strings by the way.
Any help would be really appreciated!!
Thanks. -JohnForum: Fixing WordPress
In reply to: Event Calendar rss feed display problemBump!
I’m having the same issue. I’m trying to import an RSS feed of an event calendar. This feed uses the post date for the date of the event. So, I need to have WP’s native RSS widget display posts chronologically. If I could change the way the feed works I would, but this is an institutional client who doesn’t want me messing with much.
Like scbabb, I’d go with a plugin if I could find one that did this.
Any help would be much appreciated. Thanks!
Same problem here! WP 3.1.0 | Search Everything 6.6
Anyone out there? Many thanks!
Forum: Fixing WordPress
In reply to: Gallery pagination and searchPagination for the native gallery is so necessary. I’d pay for it, and I’m sure my office would, too. Let us know if/when you have something.
I want to bump this. We were using User Access Manager http://wordpress.org/extend/plugins/user-access-manager/, but we can’t turn off safe mode on our server. All links to our files have changed to the yourdomain.com/?getfile=XXXX format, which breaks the site. (Interestingly, this only happened when we updated the site to WP 3.0.4.) We don’t mind getting rid of UAM, but want exactly what darrennye wants:
Is there some easy way to revise all the HTML Pages to show the image from the true path? I don’t know what image names were actually on which pages!
Thanks in advance!!