single.php – how to mark current page in the loop
Here’s a rewritten version of your code <ul id=”questions” class=”subpage”> <?php $current_id = get_the_ID(); $index_query = new WP_Query( array( ‘post_type’ => ‘faq’, ‘orderby’ => ‘modified’, ‘posts_per_page’ => ‘-1’, ‘order’ => ‘DESC’ ) ); while ( $index_query->have_posts() ) : $index_query->the_post(); if(get_the_ID() == $current_id) echo ‘this post has the same ID as the current global one’; ?> … Read more