New Landing How can we help? Themeforest Theme Support Dante Dante shortcodes not working when calling page with AJAX

Viewing 4 posts - 1 through 4 (of 4 total)
  • Posted in: Dante
  • #216003
    pbi design
    Member
    Post count: 82

    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.
    #216023
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    Unfortunately we can’t support customizations but try to replace this line.

    <?php the_content(); ?>

    with this one

    <?php echo do_shortcode($content); ?>

    So it would render the shortcodes, maybe you have to declare the $content variable has global.

    -Rui

    #218543
    pbi design
    Member
    Post count: 82

    Hi Rui,

    thanks for your suggestion, but it solves the issue only partly. Now we can get content from shortcodes, but the rest of content looses its styling.

    #218553
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    It’ difficult to tell since it’s customized. The style also depends on the entire html structure, you should compare with our normal pages using the same shortcodes.

    -Rui

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register