Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #17910

    I modified functions.php to add a list of taged news by using a shortcode. The Shortcode is pulled from a CPT-field.

    If I add this:

    echo apply_filters(‘the_content’, get_post_meta($post->ID, ‘news_shortcode’, true));

    my <div> inside the content gets filtered?

    //check if the portfolio item was requested by an ajax call and returns that

    if(!function_exists(‘avia_check_ajax_request’)){

    add_action(‘wp_ajax_avia_check_portfolio’, ‘avia_check_ajax_request’);

    add_action(‘wp_ajax_nopriv_avia_check_portfolio’, ‘avia_check_ajax_request’);

    function avia_check_ajax_request()

    {

    if(!isset($_POST)) return false;

    global $avia_config, $more;

    $avia_config = false;

    $avia_config = true;

    $id = $_POST;

    global $post;

    $post = get_post( $id );

    setup_postdata($post);

    $more = 0;

    $slider = new avia_slideshow($id);

    $slider -> setImageSize(‘fullsize’);

    $slider_html = $slider->display();

    echo “<div class=’ajax_slide ajax_slide_”.$id.”‘ data-slide-id=’”.$id.”‘ >”;

    echo “<div class=’inner_slide’>”;

    echo “<div class=’flex_column two_third first’>”;

    echo $slider_html;

    echo “</div>”;

    echo “<div class=’portfolio-entry one_third’>”;

    echo avia_title(array(‘class’=>’portfolio-title’, ‘html’ => “<div class=’{class} title_container’><h1 class=’main-title’>{title}</h1></div>”), $id);

    $meta = avia_portfolio_meta($id);

    if($meta)

    {

    echo $meta;

    echo avia_advanced_hr(false, ‘hr_small’);

    }

    // mg test

    echo apply_filters(‘the_content’, get_post_meta($post->ID, ‘news_shortcode’, true));

    echo “</div>”;

    echo “</div>”;

    echo “<div class=’entry-content’>”;

    the_content(__(‘Read more’,’avia_framework’).’<span class=”more-link-arrow”> →</span>’);

    echo “</div>”;

    echo “</div>”;

    echo “</div>”;

    unset($avia_config);

    die();

    }

    }

    #97459

    I think you need to save the content into a variable like:

    $content = get_the_content(__('Read more','avia_framework').'<span class="more-link-arrow"> →</span>');
    $content = apply_filters('the_content', get_post_meta($post->ID, 'news_shortcode', true));
    echo $content;

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

The topic ‘the_content filters a’ is closed to new replies.