Why is the first query affecting the second query, even after wp_reset_query() and wp_reset_postdata(), but not on the second page?

I see a number of issues, aside from the use of query_posts ( this should raise immediate alarm bells ). I strongly recommend you don’t use the alt syntax, and that you minimise the unnecessary opening and closing PHP tags as it obscures your code. Here is a cleaned up version of your first query … Read more

How to correctly add JQuery in a WP theme?

When you register/enqueue your other scripts, simply pass jQuery as the third parameter and it will be loaded first and only once, from the local WordPress files: wp_register_script( ‘theme-js’, get_template_directory_uri() . ‘/js/theme.js’, array( ‘jquery’) ); If you only need the jQuery, simply use: wp_enqueue_script(‘jquery’); You can find a list here about the javascript libraries that … Read more

Unhook action from child theme

I eventually figured this out, I don’t know exactly why, but it seems the issue was due to the original use of init, once i replaced it with ‘wp_head’ it worked correctly, my final code looked like this function change_default_galleria_header() { remove_action( ‘storefront_header’, ‘storefront_header_cart’, 4 ); remove_action( ‘storefront_header’, ‘storefront_product_search’, 3 ); remove_action( ‘storefront_header’, ‘storefront_secondary_navigation’, 6 … Read more