Witam
mam taki kod
jQuery(document).ready(function($) {
var wl = window.location;
var $nav = $( ".category-menu" );
var $content = $( ".list-container" );
var $loading = $( ".loading" );
getHash( wl.hash );
$nav.find( "a" ).click(function(){
getHash( this.hash );
});
$( window ).on( "hashchange", function(){
getHash( wl.hash );
});
function getHash( hash )
{
var pageName = hash.replace( "#", "" );
if ( !hash || hash == "" )
{
hash = "#alice";
wl.hash = hash;
}
$nav.find( "li" ).removeClass( "active" );
$( "a[href="+hash+"]" ).parent().addClass( "active" );
$.ajax({
type: "GET",
url: "../wp-content/themes/theme/load_pages.php",
data: "page="+pageName,
dataType: "html",
beforeSend: function(){
$content.hide();
},
success: function( msg ){
$loading.hide();
$content.html( msg );
$content.fadeIn( "fast" );
}
});
}
});
wszystko działa ok strony ładują mi się dynamiczne ale jest 1 problem ponieważ gdy pobieram stronę to wyświetlana jest ona jako html a ja mam na tych stronach różne funkcje w php i wyświetlają się ona jako zwykły tekst. Co mam zrobić by te funkcje działały ?
Oto Strona którą chce załadować:
<div class="list-breadcrumbs">
<h1>Title</h1>
</div>
<?php
$args = array( 'post_type' => 'product', 'posts_per_page' => 10, 'product_cat' => 'alice' );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
global $product;
echo '<div class="col-md-3">' . woocommerce_get_product_thumbnail().' '.get_the_title().'</div>';
endwhile;
wp_reset_query();
?>