Global filter not working

That’s not really how the pre_get_posts works. The original parameters you’ve sent to the function are not good. The only one required is $query. And the workaround for you will be to run your function in the pre_get_posts function to return an array of post_ID corresponding on the variation you want to include, then in … Read more

PHP drop down menu for my get_category child of

You can use the function wp_dropdown_categories() instead of wp_list_categories(), if you dont need to use the list function. wp_dropdown_categories() seems to be working just like the list function. So first just try and replace these two functions. $terms = wp_dropdown_categories( array( … Read about it in the codex here.

Getting a value from a custom field from a page that shares a parent with the current page

I’m assuming there are only two children in such cases. <?php $child_id = $post->ID; if ( $post->post_parent ) { $args = array( ‘post_parent’ => $post->post_parent, ‘post_type’ => ‘page’, ‘numberposts’ => -1, ‘post_status’ => ‘publish’ ); $children = get_children($args); if(count($children) == 2) { $child_id = $children[0]->ID == $post->ID ? $children[1]->ID : $children[0]->ID; } } if ( … Read more