Issue encountered while trying to keep website private

After reviewing a reset password link, I realised that two variables were being passed via $_GET: key and login. I’ve added the below code to the beginning of my redirect_user() function: if(isset($_GET[‘key’]) && isset($_GET[‘login’])) { return ; } It didn’t fix the issue and i was still being redirected to the login page whenever I … Read more

How to get php file based on URL in WordPress

WP determines template file by following Template Hierarchy. The process has quite a few steps between URL and resulting PHP file loaded, so generally one is not a reliable indication of the other. Outside of looking through likely template files (good enough in a simple theme) you can try dumping this with code in template_include … Read more

How to Pass Current Taxonomy Terms into new WP_Query?

Try this: add_action( ‘genesis_loop’, ‘bds_more_projects_query’ ); function bds_more_projects_query() { if ( is_singular( ‘portfolio’ ) ) { $categories = get_the_terms( $post->ID, ‘portfolio_category’ ); $cat_ids = array(); foreach ( $categories as $category ) { $cat_ids[] = $category->term_id; } $args = array( ‘post_type’ => ‘portfolio’, ‘posts_per_page’ => 4, ‘tax_query’ => array( array( ‘taxonomy’ => ‘portfolio_category’, ‘field’ => ‘id’, … Read more