<script> var file, n; file = window.location.pathname; n = file.lastIndexOf('/'); if (n >= 0) { file = file.substring(n + 1); } alert (file); </script> <?php $the_query = new WP_Query( 'page_id=tutaj chce mień to co się wyświetla w file' ); // The Loop if ( $the_query->have_posts() ) { while ( $the_query->have_posts() ) { $the_query->the_post(); } } else { // no posts found }
Odczytuje adres witryny która się ładuje dynamicznie i muszę przekazać odrazu do zapytania, tak aby strona się wczytała. Co zrobić?