37,034 reputation
21737
bio website metaflora.net
location San Francisco
age
visits member for 3 years, 7 months
seen 8 hours ago

I like bicycles and cats.

http://metaflora.net/


8h
comment Custom post types accessible from 3 urls
do those URLs redirect to a single URL, or do they display content without a redirect?
9h
comment Problem in creating a shortcode form custom post type slider
You're using template functions that echo their value in variable assignment, you need to use the equivalent get_ functions that return their value.
1d
comment Set post number to single posts
if you're just using the post ID, you can set the fields parameter to ids and your query will return just an array of post IDs, it would use less memory and simplify your code a bit.
1d
comment Using meta_query with multiple keys and compare values
the method shown in that link is definitely the way you want to go- use the posts_join and posts_where filters so you're working with the main query and not doing a custom query with wpdb.
1d
comment Using meta_query with multiple keys and compare values
your date format should be yyyymmdd to order correctly. for complex meta queries like you require, you'll have to modify the SQL directly via filters, WP_Query can't handle that.
1d
comment How to make a plugin theme-wide?
if your code is in the theme's functions.php, then it's not a plugin. have you read this?
1d
comment Rewrite Question Mark in Post Template with URL Parameter for clean URLs
something like this?
1d
comment Set post number to single posts
Seems like you could come up with something more performant and less memory consuming than querying every post. I would hook the counter on the back end and save the numbers to post meta when a post is added or deleted.
2d
comment Creating customized php files in theme folder
you could add a query var and rewrite rule, but you're better off creating a page rather than "faking" one this way. I can immediately think of 10 different issues with this- menus, widgets, sitemap, caching, plugin integration, etc.. store the ID of the order page in an option so users can choose the page, and/or auto-insert the new page.
2d
comment IF statement using custom field value (ACF radio button)
if the_field('english_or_deutsch') outputs the value, it's a string, not an array, but your if is checking in_array?
2d
answered How to update a custom post title from a front-end form using ACF fields?
2d
comment How to assign a custom post title to be the post ID?
@I_LOVE_WP sure it is, I've tested it. When you create a new post it immediately has an ID, so all the other stuff like custom fields and taxonomies have an ID to save data with. Make sure you change your_post_type to your actual post type slug in the example above.
2d
comment WP Query Sort by meta value (date)
your date format is backwards, you have to store it in the form yyyy-mm-dd to sort by date.
2d
comment $wpdb error : call to a member function insert() on a non-object
what is the context of your code? how is this file loaded? when does it run?
2d
comment WP Query Sort by meta value (date)
Do you have debugging enabled?
2d
comment Display title of child pages in shortcode
there is no parent_page, it's post_parent. and you reset the query and return inside of your while loop, so it can't possibly run for more than 1 iteration before exiting.
2d
answered How to assign a custom post title to be the post ID?
Nov
20
comment WP_Query by a category id and a custom post_type
well your first one has a typo. I assume you have debugging enabled and aren't seeing any errors? where do you set $cat_id? you can var_dump your query after and look at the generated SQL, it should reveal the issue. also, you probably shouldn't be overwriting $wp_query.
Nov
19
comment Gap between Header and Top of page in wordpress
how did you remove the admin bar? apparently you didn't completely remove it.
Nov
19
comment pre_get_posts filter meta_query without conflicting existing meta_query
I assume you want to do an AND relation with the existing meta query, but that means you can't also do an OR between your two restricted_visibility cases. the only way to handle that is to directly modify the SQL via filters.