Hi.
Situation:
I am working on a child theme. I have pages with ajax load, which is working fine, except for Dante theme shortcodes.
Problem:
Theme shortcodes which I use in my pages don’t work with ajax call. In frontend the shortcodes appear, instead of the content that they are supposed to call.
Attached a screenshot of frontend and a part of relevant code.
How can I fix this problem?
<?php
require_once( "../../../wp-load.php" );
if( $_GET && isset( $_GET['pname'] ) ){
$pagename = $_GET['pname'];
$arg = array('pagename' => $pagename);
$query = new WP_Query($arg);
?>
<?php if ($query -> have_posts()) : $query -> the_post(); ?>
<div class="spb_content_element col-sm-8 spb_text_column">
<h3 class="page-title"><?php the_title(); ?></h3>
</div>
<?php the_content(); ?>
<?php endif; ?>
<?php } ?>
Attachments:
You must be
logged in to view attached files.