Hooking get_pages()

I find the way, but it doesn”t work for my case because the plugin uses another function to link to parent pages, without using get_pages()so the result is so inconsistent. But the filter is working. // Get all posts with the meta key ‘not_in_menu’ function get_not_in_menu_posts() { $post_ids = wp_cache_get( ‘wl_not_in_menu’ ); if ( false … Read more

Create Cross Promoting Categories in WordPress Using ‘pre_get_posts’

I think I remember seeing this attempt somewhere… If I remember correctly, the solution was to use a custom tax query on the category.php template, but querying the taxonomy (crosspostcategory) FIRST in the “or” statement… So you’d check for the taxonomy first, and then query (tax query) the category taxonomy next in the OR statement. … Read more

How to second orderby in “pre_get_posts” by meta value or combine single date and time to timestamp

I’m outlining a solution for what you asked in your last comment, because this wouldn’t been fitting for the comment format. Code: function date_time_to_timestamp_meta( $post_id ) { // meta fields are saved in DATETIME, e.g. »2013-12-09 22:32:12« // here is only the date part relevant $datetime_date = get_post_meta( $post_id, ‘_start_date’, true ); // here is … Read more