Milo

San Francisco

electrocinematic.com

I like WordPress, bicycles, and cats.

http://electrocinematic.com/

10h
comment Posts active and expired in different loops
have a look at meta_query arguments. you can do the date comparison in the query rather than in the loop so you get back only posts that match. also see pre_get_posts if you want to alter the main query to add meta_query parameters.
18h
answered Wordpress subfolder installation AJAX Problem
22h
comment Plugin create pages and use templates
yes, note the addition of $page_template as function argument in ch_register_page_template( $page_template ), which gets returned in all cases.
22h
comment Plugin create pages and use templates
your code is still wrong though, and will break templates on other pages.
22h
answered Plugin create pages and use templates
1d
awarded rewrite-rules
1d
comment Same slug for custom post type archive and custom taxonomy archive?
your questions are not the same, but the answer is the same. if you have a URL pattern that could result in two different types of objects, you need to manually figure out the type before the query runs.
1d
comment Wrong Sub-Page Order
you're not setting any sort_column, so it defaults to title.
1d
comment Same slug for custom post type archive and custom taxonomy archive?
The solution is essentially the same as this answer.
2d
comment How to retrieve an array of post IDs by a particular value stored in a custom meta's array
If you need to query on data, it should ideally not be stored in an array.
2d
comment post_type_link and add_rewrite_rule
the problem isn't the lack of rewrite rules- rewrite rules already exist for the patterns you desire, but they are connected to the page post type. the challenge here is to make two different types of content that share the same pattern both resolve to the correct content, which is in fact, not easy to get right. this is why custom post types by default are prefixed with a unique slug.
2d
comment jQuery.post not working within shortcode - Wordpress Ajax
where do you set ajaxurl? are you getting any errors in your browser console?
2d
comment Display custom post type with shortcode
you should use wp_reset_postdata after a secondary loop. wp_reset_query is only necessary to restore the $wp_query global, which was not overwritten in this case. wp_reset_query also calls wp_reset_postdata internally, which is why it works here, but is unnecessary.
Feb
10
comment How to remove /page/2/ from home page?
if you just don't want pagination to appear, then modify the template to remove whatever is generating pagination.
Feb
10
comment How to remove /page/2/ from home page?
If this is just a static page and there's no pagination, then consider using a static front page under Settings > Reading and creating a new WP_Query for your random posts list.
Feb
10
comment How to remove /page/2/ from home page?
the number of pages you have is based on the contents of the main query. page/2 doesn't do anything for you because you are overwriting the main query with query_posts. Read this to learn why you should never use query_posts.
Feb
9
comment wp_reset_postdata() and wp_reset_query() inside shortcode are not working to reset original page query
I don't think you're understanding me. You are not submitting anything named post_type with your form, it is getting added by WordPress because you are sending a form element named mae, which is a post type. WordPress thinks you are trying to query for a post of type mae with slug that matches whatever is submitted with your form. That's why you can't use any form element names that conflict with query vars.
Feb
9
comment Remove base slug in CPT & CT, use CT in permalink
Ah sorry, forgot about this, glad you got it worked out!
Feb
9
comment wp_reset_postdata() and wp_reset_query() inside shortcode are not working to reset original page query
I'm not following your description of what happens exactly. When your form is submitted with a form element named mae, WordPress parses that value as part of the main query because mae is a registered query var. The query's post type is set to mae as part of this parsing process even though you've not explicitly set post_type anywhere in the form.
Feb
9
comment wp_reset_postdata() and wp_reset_query() inside shortcode are not working to reset original page query
your post types are mae and pai, you have fields with the same names. if you've not directly modified the query var parameter of your post types, then mae and pai are query vars.
1 2 3 4 5